forked from loafle/openapi-generator-original
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default * Fix test * Fix test
This commit is contained in:
@@ -47,7 +47,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
// items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=List<BigDecimal>
|
||||
@XmlElement(name = "arrayArrayNumber")
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ArrayOfNumberOnly {
|
||||
// items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=BigDecimal
|
||||
@XmlElement(name = "arrayNumber")
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -49,21 +49,21 @@ public class ArrayTest {
|
||||
// items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=String
|
||||
@XmlElement(name = "arrayOfString")
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
// Is a container wrapped=false
|
||||
// items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=List<Long>
|
||||
@XmlElement(name = "arrayArrayOfInteger")
|
||||
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";
|
||||
// Is a container wrapped=false
|
||||
// items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=List<ReadOnlyFirst>
|
||||
@XmlElement(name = "arrayArrayOfModel")
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class EnumArrays {
|
||||
// items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=String
|
||||
@XmlElement(name = "arrayEnum")
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class FileSchemaTestClass {
|
||||
// items.name=files items.baseName=files items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=ModelFile
|
||||
@XmlElement(name = "files")
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
// items.name=arrayItemsNullable items.baseName=arrayItemsNullable items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=Object
|
||||
@XmlElement(name = "arrayItemsNullable")
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
// Is a container wrapped=false
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ObjectWithDeprecatedFields {
|
||||
// items.name=bars items.baseName=bars items.xmlName= items.xmlNamespace=
|
||||
// items.example= items.type=String
|
||||
@XmlElement(name = "bars")
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class Pet {
|
||||
// items.example= items.type=Tag
|
||||
@XmlElement(name = "Tag")
|
||||
@XmlElementWrapper(name = "tag")
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
Reference in New Issue
Block a user