mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 05:46:15 +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:
@@ -24,7 +24,7 @@ import jakarta.annotation.Generated;
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
|
||||
@@ -24,7 +24,7 @@ import jakarta.annotation.Generated;
|
||||
public class ArrayOfNumberOnly {
|
||||
|
||||
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
|
||||
@@ -24,13 +24,13 @@ import jakarta.annotation.Generated;
|
||||
public class ArrayTest {
|
||||
|
||||
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
|
||||
this.justSymbol = justSymbol;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class FileSchemaTestClass {
|
||||
private File file;
|
||||
|
||||
|
||||
private List<File> files;
|
||||
private List<File> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass file(File file) {
|
||||
this.file = file;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -32,7 +32,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
private String nameString;
|
||||
|
||||
@@ -43,10 +43,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
private String prefixString;
|
||||
|
||||
@@ -57,10 +57,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
private String namespaceString;
|
||||
|
||||
@@ -71,10 +71,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
private String prefixNsString;
|
||||
|
||||
@@ -85,10 +85,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem attributeString(String attributeString) {
|
||||
this.attributeString = attributeString;
|
||||
|
||||
Reference in New Issue
Block a user