[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:
William Cheng
2023-03-17 11:58:49 +08:00
committed by GitHub
parent d0f7bd18ba
commit 3d4f7b3ce0
622 changed files with 3440 additions and 1173 deletions

View File

@@ -1051,7 +1051,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
if (ModelUtils.isArraySchema(schema)) {
if (schema.getDefault() == null) {
if (cp.isNullable || containerDefaultToNull) { // nullable or containerDefaultToNull set to true
// nullable, optional or containerDefaultToNull set to true
if (cp.isNullable || !cp.required || containerDefaultToNull) {
return null;
} else {
if (ModelUtils.isSet(schema)) {

View File

@@ -141,13 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@@ -168,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}

View File

@@ -141,13 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@@ -168,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}

View File

@@ -141,11 +141,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = new ArrayList<>();
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@@ -166,13 +164,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}

View File

@@ -158,13 +158,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@@ -185,13 +181,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}

View File

@@ -146,13 +146,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@@ -174,11 +170,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
{{#defaultValue}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@@ -51,11 +51,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isArray}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
}
@@ -64,11 +62,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
}

View File

@@ -47,11 +47,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isArray}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
}
@@ -59,11 +57,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
}

View File

@@ -53,23 +53,19 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isArray}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if ({{name}} == null) {
{{name}} = {{{defaultValue}}};
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
{{name}}.add({{name}}Item);
this.{{name}}.add({{name}}Item);
return this;
}
{{/isArray}}
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
}

View File

@@ -123,7 +123,7 @@ Declare the class with extends and implements
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{#vendorExtensions.x-is-jackson-optional-nullable}}
if (this.{{name}} == null || !this.{{name}}.isPresent()) {
this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}});
}
try {
this.{{name}}.get().add({{name}}Item);
@@ -135,7 +135,7 @@ Declare the class with extends and implements
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
@@ -148,7 +148,7 @@ Declare the class with extends and implements
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{#vendorExtensions.x-is-jackson-optional-nullable}}
if (this.{{name}} == null || !this.{{name}}.isPresent()) {
this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}});
this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}});
}
try {
this.{{name}}.get().put(key, {{name}}Item);
@@ -160,7 +160,7 @@ Declare the class with extends and implements
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);

View File

@@ -44,11 +44,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isArray}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
}
@@ -56,11 +54,9 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}});
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
}

View File

@@ -601,11 +601,11 @@ public class AbstractJavaCodegenTest {
ModelUtils.setGenerateAliasAsModel(false);
defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema);
Assert.assertEquals(defaultValue, "new ArrayList<>()");
Assert.assertEquals(defaultValue, null);
ModelUtils.setGenerateAliasAsModel(true);
defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema);
Assert.assertEquals(defaultValue, "new ArrayList<>()");
Assert.assertEquals(defaultValue, null);
// Create a map schema with additionalProperties type set to array alias
schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray"));

View File

@@ -75,7 +75,7 @@ public class JavaModelEnumTest {
Assert.assertEquals(enumVar.dataType, "List<String>");
Assert.assertEquals(enumVar.datatypeWithEnum, "List<NameEnum>");
Assert.assertEquals(enumVar.name, "name");
Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()");
Assert.assertEquals(enumVar.defaultValue, null);
Assert.assertEquals(enumVar.baseType, "List");
Assert.assertTrue(enumVar.isEnum);
@@ -108,7 +108,7 @@ public class JavaModelEnumTest {
Assert.assertEquals(enumVar.dataType, "List<List<String>>");
Assert.assertEquals(enumVar.datatypeWithEnum, "List<List<NameEnum>>");
Assert.assertEquals(enumVar.name, "name");
Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()");
Assert.assertEquals(enumVar.defaultValue, null);
Assert.assertEquals(enumVar.baseType, "List");
Assert.assertTrue(enumVar.isEnum);

View File

@@ -130,7 +130,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setUrls");
Assert.assertEquals(property.dataType, "List<String>");
Assert.assertEquals(property.name, "urls");
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "List");
Assert.assertEquals(property.containerType, "array");
Assert.assertFalse(property.required);
@@ -162,7 +162,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setUrls");
Assert.assertEquals(property.dataType, "Set<String>");
Assert.assertEquals(property.name, "urls");
Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "Set");
Assert.assertEquals(property.containerType, "set");
Assert.assertFalse(property.required);
@@ -248,7 +248,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setList2D");
Assert.assertEquals(property.dataType, "List<List<Pet>>");
Assert.assertEquals(property.name, "list2D");
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "List");
Assert.assertEquals(property.containerType, "array");
Assert.assertFalse(property.required);
@@ -333,7 +333,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setChildren");
Assert.assertEquals(property.dataType, "List<Children>");
Assert.assertEquals(property.name, "children");
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "List");
Assert.assertEquals(property.containerType, "array");
Assert.assertFalse(property.required);
@@ -396,7 +396,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setChildren");
Assert.assertEquals(property.dataType, "List<Children>");
Assert.assertEquals(property.name, "children");
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "List");
Assert.assertEquals(property.containerType, "array");
Assert.assertFalse(property.required);
@@ -429,7 +429,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setChildren");
Assert.assertEquals(property.dataType, "Set<Children>");
Assert.assertEquals(property.name, "children");
Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "Set");
Assert.assertEquals(property.containerType, "set");
Assert.assertFalse(property.required);
@@ -466,7 +466,7 @@ public class JavaModelTest {
Assert.assertEquals(property.setter, "setChildren");
Assert.assertEquals(property.dataType, "List<Child>");
Assert.assertEquals(property.name, "children");
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property.defaultValue, null);
Assert.assertEquals(property.baseType, "List");
Assert.assertEquals(property.containerType, "array");
Assert.assertFalse(property.required);
@@ -974,7 +974,7 @@ public class JavaModelTest {
Assert.assertEquals(property2.setter, "setArray");
Assert.assertEquals(property2.dataType, "List<String>");
Assert.assertEquals(property2.name, "array");
Assert.assertEquals(property2.defaultValue, "new ArrayList<>()");
Assert.assertEquals(property2.defaultValue, null);
Assert.assertEquals(property2.baseType, "List");
Assert.assertTrue(property2.isContainer);
Assert.assertTrue(property2.isXmlWrapped);

View File

@@ -98,7 +98,7 @@ public class DefaultValue {
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
private List<String> arrayString = new ArrayList<>();
private List<String> arrayString;
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();

View File

@@ -56,7 +56,7 @@ public class Pet {
private List<String> photoUrls = new ArrayList<>();
public static final String JSON_PROPERTY_TAGS = "tags";
private List<Tag> tags = new ArrayList<>();
private List<Tag> tags;
/**
* pet status in the store
@@ -186,6 +186,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -38,7 +38,7 @@ import java.util.StringJoiner;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String JSON_PROPERTY_VALUES = "values";
private List<String> values = new ArrayList<>();
private List<String> values;
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}

View File

@@ -175,7 +175,7 @@ public class CustomTest {
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
Assert.assertNull(d.getArrayStringNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
// test addItem
d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
@@ -218,9 +218,9 @@ public class CustomTest {
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
Assert.assertNull(d.getArrayStringNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}");
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}");
}
@Test
@@ -246,9 +246,9 @@ public class CustomTest {
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
Assert.assertNull(d.getArrayStringNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}");
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}");
}
@Test

View File

@@ -98,7 +98,7 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
private List<String> arrayString = new ArrayList<>();
private List<String> arrayString;
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
@@ -272,6 +272,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = new ArrayList<>();
}
this.arrayStringNullable.add(arrayStringNullableItem);
return this;
}
@@ -299,6 +302,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) {
if (this.arrayStringExtensionNullable == null) {
this.arrayStringExtensionNullable = new ArrayList<>();
}
this.arrayStringExtensionNullable.add(arrayStringExtensionNullableItem);
return this;
}

View File

@@ -49,7 +49,7 @@ public class Pet {
public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<Tag> tags = new ArrayList<>();
private List<Tag> tags;
/**
* pet status in the store
@@ -180,6 +180,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -31,7 +31,7 @@ import java.util.List;
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String SERIALIZED_NAME_VALUES = "values";
@SerializedName(SERIALIZED_NAME_VALUES)
private List<String> values = new ArrayList<>();
private List<String> values;
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}

View File

@@ -100,7 +100,7 @@ public class DefaultValue {
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
private List<String> arrayString = new ArrayList<>();
private List<String> arrayString;
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();
@@ -121,7 +121,7 @@ public class DefaultValue {
public DefaultValue addArrayStringEnumRefDefaultItem(StringEnumRef arrayStringEnumRefDefaultItem) {
if (this.arrayStringEnumRefDefault == null) {
this.arrayStringEnumRefDefault = new ArrayList<>();
this.arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE));
}
this.arrayStringEnumRefDefault.add(arrayStringEnumRefDefaultItem);
return this;
@@ -154,7 +154,7 @@ public class DefaultValue {
public DefaultValue addArrayStringEnumDefaultItem(ArrayStringEnumDefaultEnum arrayStringEnumDefaultItem) {
if (this.arrayStringEnumDefault == null) {
this.arrayStringEnumDefault = new ArrayList<>();
this.arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE));
}
this.arrayStringEnumDefault.add(arrayStringEnumDefaultItem);
return this;
@@ -187,7 +187,7 @@ public class DefaultValue {
public DefaultValue addArrayStringDefaultItem(String arrayStringDefaultItem) {
if (this.arrayStringDefault == null) {
this.arrayStringDefault = new ArrayList<>();
this.arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped"));
}
this.arrayStringDefault.add(arrayStringDefaultItem);
return this;
@@ -220,7 +220,7 @@ public class DefaultValue {
public DefaultValue addArrayIntegerDefaultItem(Integer arrayIntegerDefaultItem) {
if (this.arrayIntegerDefault == null) {
this.arrayIntegerDefault = new ArrayList<>();
this.arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
}
this.arrayIntegerDefault.add(arrayIntegerDefaultItem);
return this;

View File

@@ -58,7 +58,7 @@ public class Pet {
private List<String> photoUrls = new ArrayList<>();
public static final String JSON_PROPERTY_TAGS = "tags";
private List<Tag> tags = new ArrayList<>();
private List<Tag> tags;
/**
* pet status in the store
@@ -184,6 +184,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -117,7 +117,7 @@ public class Query {
public Query addOutcomesItem(OutcomesEnum outcomesItem) {
if (this.outcomes == null) {
this.outcomes = new ArrayList<>();
this.outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
}
this.outcomes.add(outcomesItem);
return this;

View File

@@ -39,7 +39,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
public static final String JSON_PROPERTY_VALUES = "values";
private List<String> values = new ArrayList<>();
private List<String> values;
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
}

View File

@@ -168,8 +168,7 @@ public class CustomTest {
Assert.assertNull(d.getArrayStringNullable());
Assert.assertNull(d.getArrayStringExtensionNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
// test addItem
d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
@@ -212,9 +211,9 @@ public class CustomTest {
Assert.assertNull(d.getArrayStringNullable());
Assert.assertNull(d.getArrayStringExtensionNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}");
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}");
}
@Test
@@ -241,9 +240,9 @@ public class CustomTest {
Assert.assertNull(d.getArrayStringNullable());
Assert.assertNull(d.getArrayStringExtensionNullable());
Assert.assertEquals(d.getArrayString().size(), 0);
Assert.assertNull(d.getArrayString());
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}");
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}");
}
@Test

View File

@@ -119,7 +119,7 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
private List<String> arrayString = new ArrayList<>();
private List<String> arrayString;
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
@@ -293,6 +293,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = new ArrayList<>();
}
this.arrayStringNullable.add(arrayStringNullableItem);
return this;
}
@@ -320,6 +323,9 @@ public class DefaultValue {
}
public DefaultValue addArrayStringExtensionNullableItem(String arrayStringExtensionNullableItem) {
if (this.arrayStringExtensionNullable == null) {
this.arrayStringExtensionNullable = new ArrayList<>();
}
this.arrayStringExtensionNullable.add(arrayStringExtensionNullableItem);
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 = new ArrayList<>();
private List<Tag> tags;
/**
* pet status in the store
@@ -201,6 +201,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

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

View File

@@ -19,7 +19,7 @@ class Pet {
List<String> photoUrls = new ArrayList<>()
List<Tag> tags = new ArrayList<>()
List<Tag> tags
/* pet status in the store */
String status
}

View File

@@ -101,3 +101,4 @@ public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
}
}

View File

@@ -102,3 +102,4 @@ public class AdditionalPropertiesArray extends HashMap<String, List> {
}
}

View File

@@ -101,3 +101,4 @@ public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
}
}

View File

@@ -444,3 +444,4 @@ public class AdditionalPropertiesClass {
}
}

View File

@@ -101,3 +101,4 @@ public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
}
}

View File

@@ -102,3 +102,4 @@ public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
}
}

View File

@@ -101,3 +101,4 @@ public class AdditionalPropertiesObject extends HashMap<String, Map> {
}
}

View File

@@ -101,3 +101,4 @@ public class AdditionalPropertiesString extends HashMap<String, String> {
}
}

View File

@@ -107,3 +107,4 @@ public class ArrayOfArrayOfNumberOnly {
}
}

View File

@@ -107,3 +107,4 @@ public class ArrayOfNumberOnly {
}
}

View File

@@ -139,3 +139,4 @@ public class BigCat extends Cat {
return visitor.visitBigCat(this);
}
}

View File

@@ -132,3 +132,4 @@ public class BigCatAllOf {
}
}

View File

@@ -236,3 +236,4 @@ public class Capitalization {
}
}

View File

@@ -104,3 +104,4 @@ public class Cat extends Animal {
return visitor.visitCat(this);
}
}

View File

@@ -104,3 +104,4 @@ public class Dog extends Animal {
return visitor.visitDog(this);
}
}

View File

@@ -136,3 +136,4 @@ public class FileSchemaTestClass {
}
}

View File

@@ -103,3 +103,4 @@ public class HasOnlyReadOnly {
}
}

View File

@@ -167,3 +167,4 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
}
}

View File

@@ -125,3 +125,4 @@ public class Model200Response {
}
}

View File

@@ -153,3 +153,4 @@ public class ModelApiResponse {
}
}

View File

@@ -153,3 +153,4 @@ public class OuterComposite {
}
}

View File

@@ -113,3 +113,4 @@ public class ReadOnlyFirst {
}
}

View File

@@ -216,3 +216,4 @@ public class TypeHolderDefault {
}
}

View File

@@ -244,3 +244,4 @@ public class TypeHolderExample {
}
}

View File

@@ -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() {
}

View File

@@ -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() {
}

View File

@@ -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() {
}

View File

@@ -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() {
}

View File

@@ -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() {
}

View File

@@ -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();

View File

@@ -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() {
}

View File

@@ -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;
}

View File

@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -38,13 +38,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -109,7 +109,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() {
}

View File

@@ -40,7 +40,7 @@ public class FileSchemaTestClass {
private File file;
public static final String JSON_PROPERTY_FILES = "files";
private List<File> files = new ArrayList<>();
private List<File> files;
public FileSchemaTestClass() {
}

View File

@@ -57,7 +57,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
@@ -187,6 +187,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@@ -168,6 +168,9 @@ public class TypeHolderDefault {
}
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@@ -198,6 +198,9 @@ public class TypeHolderExample {
}
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@@ -76,7 +76,7 @@ public class XmlItem {
private Boolean attributeBoolean;
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
private List<Integer> wrappedArray = new ArrayList<>();
private List<Integer> wrappedArray;
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
private String nameString;
@@ -91,10 +91,10 @@ public class XmlItem {
private Boolean nameBoolean;
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
private List<Integer> nameArray = new ArrayList<>();
private List<Integer> nameArray;
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
private List<Integer> nameWrappedArray = new ArrayList<>();
private List<Integer> nameWrappedArray;
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
private String prefixString;
@@ -109,10 +109,10 @@ public class XmlItem {
private Boolean prefixBoolean;
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
private List<Integer> prefixArray = new ArrayList<>();
private List<Integer> prefixArray;
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
private List<Integer> prefixWrappedArray = new ArrayList<>();
private List<Integer> prefixWrappedArray;
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
private String namespaceString;
@@ -127,10 +127,10 @@ public class XmlItem {
private Boolean namespaceBoolean;
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
private List<Integer> namespaceArray = new ArrayList<>();
private List<Integer> namespaceArray;
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
private List<Integer> namespaceWrappedArray = new ArrayList<>();
private List<Integer> namespaceWrappedArray;
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
private String prefixNsString;
@@ -145,10 +145,10 @@ public class XmlItem {
private Boolean prefixNsBoolean;
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
private List<Integer> prefixNsArray = new ArrayList<>();
private List<Integer> prefixNsArray;
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
private List<Integer> prefixNsWrappedArray;
public XmlItem() {
}

View File

@@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -35,7 +35,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -37,13 +37,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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() {
}

View File

@@ -108,7 +108,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() {
}

View File

@@ -39,7 +39,7 @@ public class FileSchemaTestClass {
private File file;
public static final String JSON_PROPERTY_FILES = "files";
private List<File> files = new ArrayList<>();
private List<File> files;
public FileSchemaTestClass() {
}

View File

@@ -78,7 +78,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();

View File

@@ -48,7 +48,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() {
}

Some files were not shown because too many files have changed in this diff Show More