mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-04 23:36:09 +00:00
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default * Fix test * Fix test
This commit is contained in:
@@ -39,7 +39,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
Reference in New Issue
Block a user