forked from loafle/openapi-generator-original
[Java] remove initialization for optional list property (#5363)
* set list to null in java if not required * update petstore sample for java server stub * update sample for msf4j * add null assignment to new list/map in java
This commit is contained in:
@@ -16,10 +16,10 @@ import java.util.Map;
|
||||
|
||||
public class AdditionalPropertiesClass {
|
||||
@JsonProperty("map_property")
|
||||
private Map<String, String> mapProperty = new HashMap<String, String>();
|
||||
private Map<String, String> mapProperty = null;
|
||||
|
||||
@JsonProperty("map_of_map_property")
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
@JsonProperty("ArrayArrayNumber")
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
private List<List<BigDecimal>> arrayArrayNumber = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class ArrayOfNumberOnly {
|
||||
@JsonProperty("ArrayNumber")
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
|
||||
private List<BigDecimal> arrayNumber = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -16,13 +16,13 @@ import java.util.List;
|
||||
|
||||
public class ArrayTest {
|
||||
@JsonProperty("array_of_string")
|
||||
private List<String> arrayOfString = new ArrayList<String>();
|
||||
private List<String> arrayOfString = null;
|
||||
|
||||
@JsonProperty("array_array_of_integer")
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
private List<List<Long>> arrayArrayOfInteger = null;
|
||||
|
||||
@JsonProperty("array_array_of_model")
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -81,7 +81,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
@JsonProperty("array_enum")
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
private List<ArrayEnumEnum> arrayEnum = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
|
||||
public class MapTest {
|
||||
@JsonProperty("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
|
||||
@@ -51,7 +51,7 @@ public class MapTest {
|
||||
}
|
||||
|
||||
@JsonProperty("map_of_enum_string")
|
||||
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
private Map<String, InnerEnum> mapOfEnumString = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -25,7 +25,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
private Date dateTime = null;
|
||||
|
||||
@JsonProperty("map")
|
||||
private Map<String, Animal> map = new HashMap<String, Animal>();
|
||||
private Map<String, Animal> map = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
@JsonProperty("tags")
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
private List<Tag> tags = null;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -109,11 +109,11 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "available"
|
||||
enum:
|
||||
- "available"
|
||||
- "pending"
|
||||
- "sold"
|
||||
default: "available"
|
||||
collectionFormat: "csv"
|
||||
responses:
|
||||
200:
|
||||
@@ -623,10 +623,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
- name: "enum_form_string"
|
||||
in: "formData"
|
||||
description: "Form parameter enum test (string)"
|
||||
@@ -644,10 +644,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
- name: "enum_header_string"
|
||||
in: "header"
|
||||
description: "Header parameter enum test (string)"
|
||||
@@ -665,10 +665,10 @@ paths:
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
default: "$"
|
||||
enum:
|
||||
- ">"
|
||||
- "$"
|
||||
default: "$"
|
||||
- name: "enum_query_string"
|
||||
in: "query"
|
||||
description: "Query parameter enum test (string)"
|
||||
|
||||
Reference in New Issue
Block a user