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:
@@ -29,7 +29,7 @@ import javax.annotation.Generated;
|
||||
public class ArrayOfArrayOfNumberOnlyDto {
|
||||
|
||||
@Valid
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.annotation.Generated;
|
||||
public class ArrayOfNumberOnlyDto {
|
||||
|
||||
@Valid
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnlyDto arrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
|
||||
@@ -29,13 +29,13 @@ import javax.annotation.Generated;
|
||||
public class ArrayTestDto {
|
||||
|
||||
@Valid
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<List<@Valid ReadOnlyFirstDto>> arrayArrayOfModel;
|
||||
private List<List<@Valid ReadOnlyFirstDto>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTestDto arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class EnumArraysDto {
|
||||
}
|
||||
|
||||
@Valid
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) {
|
||||
this.justSymbol = justSymbol;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class FileSchemaTestClassDto {
|
||||
private FileDto file;
|
||||
|
||||
@Valid
|
||||
private List<@Valid FileDto> files;
|
||||
private List<@Valid FileDto> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClassDto file(FileDto file) {
|
||||
this.file = file;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PetDto {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
@Valid
|
||||
private List<@Valid TagDto> tags;
|
||||
private List<@Valid TagDto> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -37,7 +37,7 @@ public class XmlItemDto {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
@Valid
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
private String nameString;
|
||||
|
||||
@@ -48,10 +48,10 @@ public class XmlItemDto {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
@Valid
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
private String prefixString;
|
||||
|
||||
@@ -62,10 +62,10 @@ public class XmlItemDto {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
@Valid
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
private String namespaceString;
|
||||
|
||||
@@ -76,10 +76,10 @@ public class XmlItemDto {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
@Valid
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
private String prefixNsString;
|
||||
|
||||
@@ -90,10 +90,10 @@ public class XmlItemDto {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
@Valid
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
@Valid
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItemDto attributeString(String attributeString) {
|
||||
this.attributeString = attributeString;
|
||||
|
||||
Reference in New Issue
Block a user