[java] fix optional array property's default value (#14961)

* fix optional array property default value

* fix default values

* more fixes

* update default value for jersey2, 3, okhttp-gson

* update default value

* fix java okhttp-gson

* fix jersey2, 3
This commit is contained in:
William Cheng
2023-03-17 11:58:49 +08:00
committed by GitHub
parent d0f7bd18ba
commit 3d4f7b3ce0
622 changed files with 3440 additions and 1173 deletions

View File

@@ -119,7 +119,7 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
private List<String> arrayString = new ArrayList<>();
private List<String> arrayString;
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
@@ -293,6 +293,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = new ArrayList<>();
}
this.arrayStringNullable.add(arrayStringNullableItem);
return this;
}
@@ -320,6 +323,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) {
if (this.arrayStringExtensionNullable == null) {
this.arrayStringExtensionNullable = new ArrayList<>();
}
this.arrayStringExtensionNullable.add(arrayStringExtensionNullableItem);
return this;
}

View File

@@ -70,7 +70,7 @@ public class Pet {
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<Tag> tags = new ArrayList<>();
private List<Tag> tags;
/**
* pet status in the store
@@ -201,6 +201,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -52,7 +52,7 @@ import org.openapitools.client.JSON;
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String SERIALIZED_NAME_VALUES = "values";
@SerializedName(SERIALIZED_NAME_VALUES)
private List<String> values = new ArrayList<>();
private List<String> values;
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}