forked from loafle/openapi-generator-original
[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:
@@ -54,35 +54,35 @@ import org.openapitools.client.JSON;
|
||||
public class AdditionalPropertiesClass {
|
||||
public static final String SERIALIZED_NAME_MAP_STRING = "map_string";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_STRING)
|
||||
private Map<String, String> mapString = null;
|
||||
private Map<String, String> mapString = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_NUMBER = "map_number";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_NUMBER)
|
||||
private Map<String, BigDecimal> mapNumber = null;
|
||||
private Map<String, BigDecimal> mapNumber = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_INTEGER = "map_integer";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_INTEGER)
|
||||
private Map<String, Integer> mapInteger = null;
|
||||
private Map<String, Integer> mapInteger = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_BOOLEAN = "map_boolean";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_BOOLEAN)
|
||||
private Map<String, Boolean> mapBoolean = null;
|
||||
private Map<String, Boolean> mapBoolean = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_ARRAY_INTEGER = "map_array_integer";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_ARRAY_INTEGER)
|
||||
private Map<String, List<Integer>> mapArrayInteger = null;
|
||||
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_ARRAY_ANYTYPE = "map_array_anytype";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_ARRAY_ANYTYPE)
|
||||
private Map<String, List<Object>> mapArrayAnytype = null;
|
||||
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_MAP_STRING = "map_map_string";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_MAP_STRING)
|
||||
private Map<String, Map<String, String>> mapMapString = null;
|
||||
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_MAP_ANYTYPE = "map_map_anytype";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_MAP_ANYTYPE)
|
||||
private Map<String, Map<String, Object>> mapMapAnytype = null;
|
||||
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1";
|
||||
@SerializedName(SERIALIZED_NAME_ANYTYPE1)
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.openapitools.client.JSON;
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER)
|
||||
private List<List<BigDecimal>> arrayArrayNumber = null;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ import org.openapitools.client.JSON;
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_NUMBER)
|
||||
private List<BigDecimal> arrayNumber = null;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -53,15 +53,15 @@ import org.openapitools.client.JSON;
|
||||
public class ArrayTest {
|
||||
public static final String SERIALIZED_NAME_ARRAY_OF_STRING = "array_of_string";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_OF_STRING)
|
||||
private List<String> arrayOfString = null;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_INTEGER)
|
||||
private List<List<Long>> arrayArrayOfInteger = null;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_OF_MODEL)
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ public class EnumArrays {
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_ENUM = "array_enum";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_ENUM)
|
||||
private List<ArrayEnumEnum> arrayEnum = null;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class FileSchemaTestClass {
|
||||
|
||||
public static final String SERIALIZED_NAME_FILES = "files";
|
||||
@SerializedName(SERIALIZED_NAME_FILES)
|
||||
private List<ModelFile> files = null;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.openapitools.client.JSON;
|
||||
public class MapTest {
|
||||
public static final String SERIALIZED_NAME_MAP_MAP_OF_STRING = "map_map_of_string";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_MAP_OF_STRING)
|
||||
private Map<String, Map<String, String>> mapMapOfString = null;
|
||||
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Gets or Sets inner
|
||||
@@ -103,15 +103,15 @@ public class MapTest {
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP_OF_ENUM_STRING = "map_of_enum_string";
|
||||
@SerializedName(SERIALIZED_NAME_MAP_OF_ENUM_STRING)
|
||||
private Map<String, InnerEnum> mapOfEnumString = null;
|
||||
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_DIRECT_MAP = "direct_map";
|
||||
@SerializedName(SERIALIZED_NAME_DIRECT_MAP)
|
||||
private Map<String, Boolean> directMap = null;
|
||||
private Map<String, Boolean> directMap = new HashMap<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_INDIRECT_MAP = "indirect_map";
|
||||
@SerializedName(SERIALIZED_NAME_INDIRECT_MAP)
|
||||
private Map<String, Boolean> indirectMap = null;
|
||||
private Map<String, Boolean> indirectMap = new HashMap<>();
|
||||
|
||||
public MapTest() {
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
|
||||
public static final String SERIALIZED_NAME_MAP = "map";
|
||||
@SerializedName(SERIALIZED_NAME_MAP)
|
||||
private Map<String, Animal> map = null;
|
||||
private Map<String, Animal> map = new HashMap<>();
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass() {
|
||||
}
|
||||
|
||||
@@ -72,7 +72,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
|
||||
|
||||
@@ -69,7 +69,7 @@ public class XmlItem {
|
||||
|
||||
public static final String SERIALIZED_NAME_WRAPPED_ARRAY = "wrapped_array";
|
||||
@SerializedName(SERIALIZED_NAME_WRAPPED_ARRAY)
|
||||
private List<Integer> wrappedArray = null;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_NAME_STRING = "name_string";
|
||||
@SerializedName(SERIALIZED_NAME_NAME_STRING)
|
||||
@@ -89,11 +89,11 @@ public class XmlItem {
|
||||
|
||||
public static final String SERIALIZED_NAME_NAME_ARRAY = "name_array";
|
||||
@SerializedName(SERIALIZED_NAME_NAME_ARRAY)
|
||||
private List<Integer> nameArray = null;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
@SerializedName(SERIALIZED_NAME_NAME_WRAPPED_ARRAY)
|
||||
private List<Integer> nameWrappedArray = null;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_STRING = "prefix_string";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_STRING)
|
||||
@@ -113,11 +113,11 @@ public class XmlItem {
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_ARRAY = "prefix_array";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_ARRAY)
|
||||
private List<Integer> prefixArray = null;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_WRAPPED_ARRAY)
|
||||
private List<Integer> prefixWrappedArray = null;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_NAMESPACE_STRING = "namespace_string";
|
||||
@SerializedName(SERIALIZED_NAME_NAMESPACE_STRING)
|
||||
@@ -137,11 +137,11 @@ public class XmlItem {
|
||||
|
||||
public static final String SERIALIZED_NAME_NAMESPACE_ARRAY = "namespace_array";
|
||||
@SerializedName(SERIALIZED_NAME_NAMESPACE_ARRAY)
|
||||
private List<Integer> namespaceArray = null;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
@SerializedName(SERIALIZED_NAME_NAMESPACE_WRAPPED_ARRAY)
|
||||
private List<Integer> namespaceWrappedArray = null;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_NS_STRING)
|
||||
@@ -161,11 +161,11 @@ public class XmlItem {
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_NS_ARRAY)
|
||||
private List<Integer> prefixNsArray = null;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
@SerializedName(SERIALIZED_NAME_PREFIX_NS_WRAPPED_ARRAY)
|
||||
private List<Integer> prefixNsWrappedArray = null;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user