[Java] fix default value for JsonNullable (#14703)

* fix java webclient default value

* update default value in java okhttp client

* fix java native client default value in JsonNullable

* improve java okhttp-gson default value template

* update java rest-related templates

* update feign samples

* update jersey3 templates

* update jersey2 templates

* update default value in jaxrs templates

* fix spring default value

* update jaxrs pojo, fix tests

* update samples

* suport set
This commit is contained in:
William Cheng
2023-02-16 10:37:36 +08:00
committed by GitHub
parent 8b0b4b5d04
commit 71c2abf81c
230 changed files with 645 additions and 839 deletions

View File

@@ -54,7 +54,7 @@ import org.openapitools.client.JSON;
public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT = "array_string_enum_ref_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT)
private List<StringEnumRef> arrayStringEnumRefDefault = null;
private List<StringEnumRef> arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE));
/**
* Gets or Sets arrayStringEnumDefault
@@ -107,23 +107,23 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_ENUM_DEFAULT = "array_string_enum_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_ENUM_DEFAULT)
private List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = null;
private List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE));
public static final String SERIALIZED_NAME_ARRAY_STRING_DEFAULT = "array_string_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_DEFAULT)
private List<String> arrayStringDefault = null;
private List<String> arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped"));
public static final String SERIALIZED_NAME_ARRAY_INTEGER_DEFAULT = "array_integer_default";
@SerializedName(SERIALIZED_NAME_ARRAY_INTEGER_DEFAULT)
private List<Integer> arrayIntegerDefault = null;
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
private List<String> arrayString = null;
private List<String> arrayString = new ArrayList<>();
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
private List<String> arrayStringNullable = null;
private List<String> arrayStringNullable;
public static final String SERIALIZED_NAME_STRING_NULLABLE = "string_nullable";
@SerializedName(SERIALIZED_NAME_STRING_NULLABLE)
@@ -289,9 +289,6 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = null;
}
this.arrayStringNullable.add(arrayStringNullableItem);
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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@@ -105,7 +105,7 @@ public class Query {
public static final String SERIALIZED_NAME_OUTCOMES = "outcomes";
@SerializedName(SERIALIZED_NAME_OUTCOMES)
private List<OutcomesEnum> outcomes = null;
private List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
public Query() {
}

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 = null;
private List<String> values = new ArrayList<>();
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}