mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 01:12:43 +00:00
[java] fix optional array property's default value (#14961)
* fix optional array property default value * fix default values * more fixes * update default value for jersey2, 3, okhttp-gson * update default value * fix java okhttp-gson * fix jersey2, 3
This commit is contained in:
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
private List<BigDecimal> arrayNumber;
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
private List<String> arrayOfString;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
private List<ModelFile> files;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
private List<Tag> tags;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -185,6 +185,9 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
if (this.photoUrls == null) {
|
||||
this.photoUrls = new LinkedHashSet<>();
|
||||
}
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -165,6 +165,9 @@ public class TypeHolderDefault {
|
||||
}
|
||||
|
||||
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
|
||||
if (this.arrayItem == null) {
|
||||
this.arrayItem = new ArrayList<>();
|
||||
}
|
||||
this.arrayItem.add(arrayItemItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -194,6 +194,9 @@ public class TypeHolderExample {
|
||||
}
|
||||
|
||||
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
|
||||
if (this.arrayItem == null) {
|
||||
this.arrayItem = new ArrayList<>();
|
||||
}
|
||||
this.arrayItem.add(arrayItemItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
private List<Integer> wrappedArray;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
|
||||
private String nameString;
|
||||
@@ -93,10 +93,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
private List<Integer> nameArray;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
private List<Integer> nameWrappedArray;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
|
||||
private String prefixString;
|
||||
@@ -111,10 +111,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
private List<Integer> prefixArray;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
private List<Integer> prefixWrappedArray;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
|
||||
private String namespaceString;
|
||||
@@ -129,10 +129,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
private List<Integer> namespaceArray;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
private String prefixNsString;
|
||||
@@ -147,10 +147,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
private List<Integer> prefixNsArray;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user