[java-client] set collection to null when not required (#3615)

* [java][model] set collection to null when not required

* Fix tests

* Fix trailing whitespace

* generate samples

* Restore 'de.thetaphi' plugin in pom.xml
This commit is contained in:
Jérémie Bresson
2019-08-15 16:01:19 +02:00
committed by William Cheng
parent 2ada4d90b4
commit a4811c7850
234 changed files with 700 additions and 691 deletions

View File

@@ -32,35 +32,35 @@ import java.util.Map;
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
@JsonProperty(JSON_PROPERTY_MAP_STRING)
private Map<String, String> mapString = new HashMap<String, String>();
private Map<String, String> mapString = null;
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
@JsonProperty(JSON_PROPERTY_MAP_NUMBER)
private Map<String, BigDecimal> mapNumber = new HashMap<String, BigDecimal>();
private Map<String, BigDecimal> mapNumber = null;
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
@JsonProperty(JSON_PROPERTY_MAP_INTEGER)
private Map<String, Integer> mapInteger = new HashMap<String, Integer>();
private Map<String, Integer> mapInteger = null;
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
@JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
private Map<String, Boolean> mapBoolean = new HashMap<String, Boolean>();
private Map<String, Boolean> mapBoolean = null;
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
private Map<String, List<Integer>> mapArrayInteger = new HashMap<String, List<Integer>>();
private Map<String, List<Integer>> mapArrayInteger = null;
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
private Map<String, List<Object>> mapArrayAnytype = new HashMap<String, List<Object>>();
private Map<String, List<Object>> mapArrayAnytype = null;
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
@JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
private Map<String, Map<String, String>> mapMapString = new HashMap<String, Map<String, String>>();
private Map<String, Map<String, String>> mapMapString = null;
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
@JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE)
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<String, Map<String, Object>>();
private Map<String, Map<String, Object>> mapMapAnytype = null;
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
@JsonProperty(JSON_PROPERTY_ANYTYPE1)

View File

@@ -31,7 +31,7 @@ import java.util.List;
public class ArrayOfArrayOfNumberOnly {
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER)
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
private List<List<BigDecimal>> arrayArrayNumber = null;
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;

View File

@@ -31,7 +31,7 @@ import java.util.List;
public class ArrayOfNumberOnly {
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
@JsonProperty(JSON_PROPERTY_ARRAY_NUMBER)
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
private List<BigDecimal> arrayNumber = null;
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;

View File

@@ -31,15 +31,15 @@ import org.openapitools.client.model.ReadOnlyFirst;
public class ArrayTest {
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
@JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING)
private List<String> arrayOfString = new ArrayList<String>();
private List<String> arrayOfString = null;
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER)
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
private List<List<Long>> arrayArrayOfInteger = null;
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL)
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;

View File

@@ -104,7 +104,7 @@ public class EnumArrays {
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
@JsonProperty(JSON_PROPERTY_ARRAY_ENUM)
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
private List<ArrayEnumEnum> arrayEnum = null;
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;

View File

@@ -34,7 +34,7 @@ public class FileSchemaTestClass {
public static final String JSON_PROPERTY_FILES = "files";
@JsonProperty(JSON_PROPERTY_FILES)
private List<java.io.File> files = new ArrayList<java.io.File>();
private List<java.io.File> files = null;
public FileSchemaTestClass file(java.io.File file) {
this.file = file;

View File

@@ -31,7 +31,7 @@ import java.util.Map;
public class MapTest {
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string";
@JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING)
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
private Map<String, Map<String, String>> mapMapOfString = null;
/**
* Gets or Sets inner
@@ -70,15 +70,15 @@ public class MapTest {
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
@JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING)
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
private Map<String, InnerEnum> mapOfEnumString = null;
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
@JsonProperty(JSON_PROPERTY_DIRECT_MAP)
private Map<String, Boolean> directMap = new HashMap<String, Boolean>();
private Map<String, Boolean> directMap = null;
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
@JsonProperty(JSON_PROPERTY_INDIRECT_MAP)
private Map<String, Boolean> indirectMap = new HashMap<String, Boolean>();
private Map<String, Boolean> indirectMap = null;
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;

View File

@@ -42,7 +42,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP = "map";
@JsonProperty(JSON_PROPERTY_MAP)
private Map<String, Animal> map = new HashMap<String, Animal>();
private Map<String, Animal> map = null;
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
this.uuid = uuid;

View File

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

View File

@@ -47,7 +47,7 @@ public class XmlItem {
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
@JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY)
private List<Integer> wrappedArray = new ArrayList<Integer>();
private List<Integer> wrappedArray = null;
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
@JsonProperty(JSON_PROPERTY_NAME_STRING)
@@ -67,11 +67,11 @@ public class XmlItem {
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
@JsonProperty(JSON_PROPERTY_NAME_ARRAY)
private List<Integer> nameArray = new ArrayList<Integer>();
private List<Integer> nameArray = null;
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
@JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY)
private List<Integer> nameWrappedArray = new ArrayList<Integer>();
private List<Integer> nameWrappedArray = null;
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
@JsonProperty(JSON_PROPERTY_PREFIX_STRING)
@@ -91,11 +91,11 @@ public class XmlItem {
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
@JsonProperty(JSON_PROPERTY_PREFIX_ARRAY)
private List<Integer> prefixArray = new ArrayList<Integer>();
private List<Integer> prefixArray = null;
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
@JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY)
private List<Integer> prefixWrappedArray = new ArrayList<Integer>();
private List<Integer> prefixWrappedArray = null;
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
@JsonProperty(JSON_PROPERTY_NAMESPACE_STRING)
@@ -115,11 +115,11 @@ public class XmlItem {
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
@JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY)
private List<Integer> namespaceArray = new ArrayList<Integer>();
private List<Integer> namespaceArray = null;
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
@JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY)
private List<Integer> namespaceWrappedArray = new ArrayList<Integer>();
private List<Integer> namespaceWrappedArray = null;
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
@JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING)
@@ -139,11 +139,11 @@ public class XmlItem {
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
@JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY)
private List<Integer> prefixNsArray = new ArrayList<Integer>();
private List<Integer> prefixNsArray = null;
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
@JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY)
private List<Integer> prefixNsWrappedArray = new ArrayList<Integer>();
private List<Integer> prefixNsWrappedArray = null;
public XmlItem attributeString(String attributeString) {
this.attributeString = attributeString;