forked from loafle/openapi-generator-original
[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:
@@ -38,7 +38,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
private List<BigDecimal> arrayNumber;
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
private List<String> arrayOfString;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
private List<ModelFile> files;
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
private List<Object> arrayItemsNullable;
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars = new ArrayList<>();
|
||||
private List<String> bars;
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
private List<Tag> tags;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -189,6 +189,9 @@ public class Pet {
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
if (this.photoUrls == null) {
|
||||
this.photoUrls = new LinkedHashSet<>();
|
||||
}
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user