Fix default empty collections when collection is optional (#18080)

* Fix optional empty collection as default

* Fix test

* Fix test
This commit is contained in:
Dennis Melzer
2024-03-14 13:28:27 +01:00
committed by GitHub
parent 6075b8a8f1
commit 96bf7ac915
495 changed files with 1548 additions and 1481 deletions

View File

@@ -96,7 +96,7 @@ public class DefaultValue {
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
private List<String> arrayString;
private List<String> arrayString = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();

View File

@@ -54,7 +54,7 @@ public class Pet {
private List<String> photoUrls = new ArrayList<>();
public static final String JSON_PROPERTY_TAGS = "tags";
private List<Tag> tags;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String JSON_PROPERTY_VALUES = "values";
private List<String> values;
private List<String> values = new ArrayList<>();
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}