forked from loafle/openapi-generator-original
* #3908 make a copy of vendorExtensions map instead of copying the reference * using 4-space instead of tab. * make a copy of vendorExtensions map instead of copying the reference
This commit is contained in:
parent
cde24f1113
commit
a260636a48
@ -122,7 +122,9 @@ public class CodegenParameter {
|
|||||||
if (this.items != null) {
|
if (this.items != null) {
|
||||||
output.items = this.items;
|
output.items = this.items;
|
||||||
}
|
}
|
||||||
output.vendorExtensions = this.vendorExtensions;
|
if(this.vendorExtensions != null){
|
||||||
|
output.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
|
||||||
|
}
|
||||||
output.hasValidation = this.hasValidation;
|
output.hasValidation = this.hasValidation;
|
||||||
output.isBinary = this.isBinary;
|
output.isBinary = this.isBinary;
|
||||||
output.isByteArray = this.isByteArray;
|
output.isByteArray = this.isByteArray;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package io.swagger.codegen;
|
package io.swagger.codegen;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -283,9 +285,24 @@ public class CodegenProperty implements Cloneable {
|
|||||||
@Override
|
@Override
|
||||||
public CodegenProperty clone() {
|
public CodegenProperty clone() {
|
||||||
try {
|
try {
|
||||||
return (CodegenProperty) super.clone();
|
CodegenProperty cp = (CodegenProperty) super.clone();
|
||||||
|
if (this._enum != null) {
|
||||||
|
cp._enum = new ArrayList<String>(this._enum);
|
||||||
|
}
|
||||||
|
if (this.allowableValues != null) {
|
||||||
|
cp.allowableValues = new HashMap<String, Object>(this.allowableValues);
|
||||||
|
}
|
||||||
|
if (this.items != null) {
|
||||||
|
cp.items = this.items;
|
||||||
|
}
|
||||||
|
if(this.vendorExtensions != null){
|
||||||
|
cp.vendorExtensions = new HashMap<String, Object>(this.vendorExtensions);
|
||||||
|
}
|
||||||
|
return cp;
|
||||||
} catch (CloneNotSupportedException e) {
|
} catch (CloneNotSupportedException e) {
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user