[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:
William Cheng 2023-02-16 10:37:36 +08:00 committed by GitHub
parent 8b0b4b5d04
commit 71c2abf81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
230 changed files with 645 additions and 839 deletions

View File

@ -1038,7 +1038,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
if (ModelUtils.isArraySchema(schema)) {
if (schema.getDefault() == null) {
if (cp.isNullable || containerDefaultToNull) { // nullable or containerDefaultToNull set to true
return "null";
return null;
} else {
if (ModelUtils.isSet(schema)) {
return String.format(Locale.ROOT, "new %s<>()",
@ -1061,7 +1061,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
if (cp.isNullable || containerDefaultToNull) { // nullable or containerDefaultToNull set to true
return "null";
return null;
}
if (getAdditionalProperties(schema) == null) {

View File

@ -82,12 +82,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
@ -136,7 +131,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -147,9 +142,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
@ -161,7 +158,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -172,9 +169,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@ -82,12 +82,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
@ -136,7 +131,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -147,9 +142,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
@ -161,7 +158,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -172,9 +169,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@ -82,12 +82,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
@ -136,7 +131,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -161,7 +156,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -172,9 +167,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@ -101,12 +101,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
{{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
@ -153,7 +148,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -164,9 +159,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
@ -178,7 +175,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -189,9 +186,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@ -84,7 +84,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}};
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{^isContainer}}
{{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
@ -134,7 +134,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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}}}{{^defaultValue}}null{{/defaultValue}});
this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}});
}
try {
this.{{name}}.get().add({{name}}Item);
@ -145,9 +145,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.add({{name}}Item);
return this;
@ -159,7 +161,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
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);
@ -170,9 +172,11 @@ 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}}};
}
{{/defaultValue}}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;

View File

@ -18,12 +18,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}{{/vars}}
{{/vars}}
{{#vars}}
/**
@ -57,7 +53,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
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);
@ -70,7 +66,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
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);

View File

@ -51,12 +51,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
{{#vars}}
/**

View File

@ -47,12 +47,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{/vars}}
{{#vars}}
@ -156,7 +151,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
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}});
}
this.{{name}}.get().add({{name}}Item);
return this;
@ -172,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
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}});
}
this.{{name}}.get().put(key, {{name}}Item);
return this;

View File

@ -36,12 +36,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
{{#vars}}
@ -54,7 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
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);
@ -66,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
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);

View File

@ -31,12 +31,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{datatypeWithEnum}}} {{name}}{{#required}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}}{{#isNullable}} = null{{/isNullable}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
private {{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vars}}
{{#generateBuilders}}
{{^additionalProperties}}
@ -88,7 +83,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isArray}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
this.{{name}}.add({{name}}Item);
@ -106,7 +101,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
this.{{name}}.put(key, {{name}}Item);

View File

@ -96,7 +96,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#openApiNullable}}
{{^required}}
if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) {
this.{{name}} = {{#isNullable}}JsonNullable.of({{{defaultValue}}}){{/isNullable}}{{^isNullable}}{{{defaultValue}}}{{/isNullable}};
this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}};
}
{{/required}}
this.{{name}}{{#isNullable}}.get(){{/isNullable}}.add({{name}}Item);
@ -115,7 +115,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
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);

View File

@ -711,12 +711,12 @@ public class JavaJAXRSSpecServerCodegenTest extends JavaJaxrsBaseTest {
//And the generated model contains correct default value for array properties (optional)
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/model/Body.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/model/Body.java"),
"\nprivate @Valid List<String> arrayThatIsNull = null;\n");
"\nprivate @Valid List<String> arrayThatIsNull;\n");
//And the generated model contains correct default value for array properties (required, nullable)
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/model/BodyWithRequiredNullable.java");
assertFileContains(output.toPath().resolve("src/gen/java/org/openapitools/model/BodyWithRequiredNullable.java"),
"\nprivate @Valid List<String> arrayThatIsNull = null;\n");
"\nprivate @Valid List<String> arrayThatIsNull;\n");
//And the generated model contains correct default value for array properties (required)
TestUtils.ensureContainsFile(files, output, "src/gen/java/org/openapitools/model/BodyWithRequired.java");

View File

@ -286,7 +286,7 @@ public class DefaultValue {
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null || !this.arrayStringNullable.isPresent()) {
this.arrayStringNullable = JsonNullable.<List<String>>of(null);
this.arrayStringNullable = JsonNullable.<List<String>>of(new ArrayList<>());
}
try {
this.arrayStringNullable.get().add(arrayStringNullableItem);

View File

@ -102,7 +102,7 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
private List<String> arrayStringNullable = null;
private List<String> arrayStringNullable;
public static final String SERIALIZED_NAME_STRING_NULLABLE = "string_nullable";
@SerializedName(SERIALIZED_NAME_STRING_NULLABLE)
@ -268,9 +268,6 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = null;
}
this.arrayStringNullable.add(arrayStringNullableItem);
return this;
}

View File

@ -282,7 +282,7 @@ public class DefaultValue {
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null || !this.arrayStringNullable.isPresent()) {
this.arrayStringNullable = JsonNullable.<List<String>>of(null);
this.arrayStringNullable = JsonNullable.<List<String>>of(new ArrayList<>());
}
try {
this.arrayStringNullable.get().add(arrayStringNullableItem);

View File

@ -54,7 +54,7 @@ import org.openapitools.client.JSON;
public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT = "array_string_enum_ref_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_ENUM_REF_DEFAULT)
private List<StringEnumRef> arrayStringEnumRefDefault = null;
private List<StringEnumRef> arrayStringEnumRefDefault = new ArrayList<>(Arrays.asList(StringEnumRef.SUCCESS, StringEnumRef.FAILURE));
/**
* Gets or Sets arrayStringEnumDefault
@ -107,23 +107,23 @@ public class DefaultValue {
public static final String SERIALIZED_NAME_ARRAY_STRING_ENUM_DEFAULT = "array_string_enum_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_ENUM_DEFAULT)
private List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = null;
private List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = new ArrayList<>(Arrays.asList(ArrayStringEnumDefaultEnum.SUCCESS, ArrayStringEnumDefaultEnum.FAILURE));
public static final String SERIALIZED_NAME_ARRAY_STRING_DEFAULT = "array_string_default";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_DEFAULT)
private List<String> arrayStringDefault = null;
private List<String> arrayStringDefault = new ArrayList<>(Arrays.asList("failure", "skipped"));
public static final String SERIALIZED_NAME_ARRAY_INTEGER_DEFAULT = "array_integer_default";
@SerializedName(SERIALIZED_NAME_ARRAY_INTEGER_DEFAULT)
private List<Integer> arrayIntegerDefault = null;
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
private List<String> arrayString = null;
private List<String> arrayString = new ArrayList<>();
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
private List<String> arrayStringNullable = null;
private List<String> arrayStringNullable;
public static final String SERIALIZED_NAME_STRING_NULLABLE = "string_nullable";
@SerializedName(SERIALIZED_NAME_STRING_NULLABLE)
@ -289,9 +289,6 @@ public class DefaultValue {
}
public DefaultValue addArrayStringNullableItem(String arrayStringNullableItem) {
if (this.arrayStringNullable == null) {
this.arrayStringNullable = null;
}
this.arrayStringNullable.add(arrayStringNullableItem);
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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@ -105,7 +105,7 @@ public class Query {
public static final String SERIALIZED_NAME_OUTCOMES = "outcomes";
@SerializedName(SERIALIZED_NAME_OUTCOMES)
private List<OutcomesEnum> outcomes = null;
private List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
public Query() {
}

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

View File

@ -308,7 +308,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayNullableProp.get().add(arrayNullablePropItem);
@ -354,7 +354,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
@ -434,7 +434,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
@ -480,7 +480,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);

View File

@ -305,7 +305,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayNullableProp.get().add(arrayNullablePropItem);
@ -351,7 +351,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
@ -431,7 +431,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
@ -477,7 +477,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);

View File

@ -49,28 +49,28 @@ import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
private Object anytype1;

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@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 = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnly() {
}

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@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 = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnly() {
}

View File

@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
@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 = null;
private List<String> arrayOfString = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
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 = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
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 = null;
private List<ModelFile> files = new ArrayList<>();
public FileSchemaTestClass() {
}

View File

@ -40,7 +40,7 @@ import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MapTest {
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "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
@ -78,13 +78,13 @@ public class MapTest {
}
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTest() {
}

View File

@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private LocalDateTime dateTime;
public static final String JSON_PROPERTY_MAP = "map";
private Map<String, Animal> map = null;
private Map<String, Animal> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClass() {
}

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

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

View File

@ -49,28 +49,28 @@ import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
private Object anytype1;

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@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 = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnly() {
}

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@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 = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnly() {
}

View File

@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
@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 = null;
private List<String> arrayOfString = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
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 = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
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 = null;
private List<ModelFile> files = new ArrayList<>();
public FileSchemaTestClass() {
}

View File

@ -40,7 +40,7 @@ import org.openapitools.client.JSON;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MapTest {
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "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
@ -78,13 +78,13 @@ public class MapTest {
}
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTest() {
}

View File

@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private OffsetDateTime dateTime;
public static final String JSON_PROPERTY_MAP = "map";
private Map<String, Animal> map = null;
private Map<String, Animal> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClass() {
}

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

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

View File

@ -48,10 +48,10 @@ import org.openapitools.client.JSON;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property";
private Map<String, String> mapProperty = null;
private Map<String, String> mapProperty = new HashMap<>();
public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property";
private Map<String, Map<String, String>> mapOfMapProperty = null;
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<>();
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
private JsonNullable<Object> anytype1 = JsonNullable.<Object>of(null);
@ -63,13 +63,13 @@ public class AdditionalPropertiesClass {
private Object mapWithUndeclaredPropertiesAnytype2;
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3";
private Map<String, Object> mapWithUndeclaredPropertiesAnytype3 = null;
private Map<String, Object> mapWithUndeclaredPropertiesAnytype3 = new HashMap<>();
public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map";
private Object emptyMap;
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string";
private Map<String, String> mapWithUndeclaredPropertiesString = null;
private Map<String, String> mapWithUndeclaredPropertiesString = new HashMap<>();
public AdditionalPropertiesClass() {
}

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@jakarta.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 = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnly() {
}

View File

@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class ArrayOfNumberOnly {
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
private List<BigDecimal> arrayNumber = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnly() {
}

View File

@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
@jakarta.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 = null;
private List<String> arrayOfString = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
public ArrayTest() {
}

View File

@ -61,7 +61,7 @@ public class Drawing {
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
public static final String JSON_PROPERTY_SHAPES = "shapes";
private List<Shape> shapes = null;
private List<Shape> shapes = new ArrayList<>();
public Drawing() {
}

View File

@ -111,7 +111,7 @@ public class EnumArrays {
}
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
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 = null;
private List<ModelFile> files = new ArrayList<>();
public FileSchemaTestClass() {
}

View File

@ -40,7 +40,7 @@ import org.openapitools.client.JSON;
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MapTest {
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "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
@ -78,13 +78,13 @@ public class MapTest {
}
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTest() {
}

View File

@ -48,7 +48,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private OffsetDateTime dateTime;
public static final String JSON_PROPERTY_MAP = "map";
private Map<String, Animal> map = null;
private Map<String, Animal> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClass() {
}

View File

@ -85,7 +85,7 @@ public class NullableClass {
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 = null;
private List<Object> arrayItemsNullable = new ArrayList<>();
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
@ -94,7 +94,7 @@ public class NullableClass {
private JsonNullable<Map<String, Object>> objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>undefined();
public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable";
private Map<String, Object> objectItemsNullable = null;
private Map<String, Object> objectItemsNullable = new HashMap<>();
public NullableClass() {
}
@ -304,7 +304,7 @@ public class NullableClass {
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayNullableProp.get().add(arrayNullablePropItem);
@ -349,7 +349,7 @@ public class NullableClass {
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
@ -427,7 +427,7 @@ public class NullableClass {
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
@ -472,7 +472,7 @@ public class NullableClass {
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);

View File

@ -51,7 +51,7 @@ public class ObjectWithDeprecatedFields {
private DeprecatedObject deprecatedRef;
public static final String JSON_PROPERTY_BARS = "bars";
private List<String> bars = null;
private List<String> bars = new ArrayList<>();
public ObjectWithDeprecatedFields() {
}

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@ -306,7 +306,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayNullableProp.get().add(arrayNullablePropItem);
@ -351,7 +351,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
@ -429,7 +429,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
@ -474,7 +474,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);

View File

@ -306,7 +306,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayNullableProp.get().add(arrayNullablePropItem);
@ -351,7 +351,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(null);
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
}
try {
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
@ -429,7 +429,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectNullableProp.get().put(key, objectNullablePropItem);
@ -474,7 +474,7 @@ public class NullableClass extends HashMap<String, Object> {
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(null);
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(new HashMap<>());
}
try {
this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem);

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@ -56,35 +56,35 @@ import org.openapitools.client.JSON;
public class AdditionalPropertiesClass implements Parcelable {
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)

View File

@ -55,7 +55,7 @@ import org.openapitools.client.JSON;
public class ArrayOfArrayOfNumberOnly implements Parcelable {
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() {
}

View File

@ -55,7 +55,7 @@ import org.openapitools.client.JSON;
public class ArrayOfNumberOnly implements Parcelable {
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() {
}

View File

@ -55,15 +55,15 @@ import org.openapitools.client.JSON;
public class ArrayTest implements Parcelable {
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() {
}

View File

@ -152,7 +152,7 @@ public class EnumArrays implements Parcelable {
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() {
}

View File

@ -59,7 +59,7 @@ public class FileSchemaTestClass implements Parcelable {
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() {
}

View File

@ -54,7 +54,7 @@ import org.openapitools.client.JSON;
public class MapTest implements Parcelable {
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
@ -105,15 +105,15 @@ public class MapTest implements Parcelable {
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() {
}

View File

@ -65,7 +65,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable {
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() {
}

View File

@ -74,7 +74,7 @@ public class Pet implements Parcelable {
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

View File

@ -71,7 +71,7 @@ public class XmlItem implements Parcelable {
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)
@ -91,11 +91,11 @@ public class XmlItem implements Parcelable {
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)
@ -115,11 +115,11 @@ public class XmlItem implements Parcelable {
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)
@ -139,11 +139,11 @@ public class XmlItem implements Parcelable {
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)
@ -163,11 +163,11 @@ public class XmlItem implements Parcelable {
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() {
}

View File

@ -73,7 +73,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

View File

@ -53,11 +53,11 @@ import org.openapitools.client.JSON;
public class AdditionalPropertiesClass {
public static final String SERIALIZED_NAME_MAP_PROPERTY = "map_property";
@SerializedName(SERIALIZED_NAME_MAP_PROPERTY)
private Map<String, String> mapProperty = null;
private Map<String, String> mapProperty = new HashMap<>();
public static final String SERIALIZED_NAME_MAP_OF_MAP_PROPERTY = "map_of_map_property";
@SerializedName(SERIALIZED_NAME_MAP_OF_MAP_PROPERTY)
private Map<String, Map<String, String>> mapOfMapProperty = null;
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<>();
public static final String SERIALIZED_NAME_ANYTYPE1 = "anytype_1";
@SerializedName(SERIALIZED_NAME_ANYTYPE1)
@ -73,7 +73,7 @@ public class AdditionalPropertiesClass {
public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3";
@SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3)
private Map<String, Object> mapWithUndeclaredPropertiesAnytype3 = null;
private Map<String, Object> mapWithUndeclaredPropertiesAnytype3 = new HashMap<>();
public static final String SERIALIZED_NAME_EMPTY_MAP = "empty_map";
@SerializedName(SERIALIZED_NAME_EMPTY_MAP)
@ -81,7 +81,7 @@ public class AdditionalPropertiesClass {
public static final String SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string";
@SerializedName(SERIALIZED_NAME_MAP_WITH_UNDECLARED_PROPERTIES_STRING)
private Map<String, String> mapWithUndeclaredPropertiesString = null;
private Map<String, String> mapWithUndeclaredPropertiesString = new HashMap<>();
public AdditionalPropertiesClass() {
}

View File

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

View File

@ -61,7 +61,7 @@ public class ArrayOfInlineAllOf {
public static final String SERIALIZED_NAME_ARRAY_ALLOF_DOG_PROPERTY = "array_allof_dog_property";
@SerializedName(SERIALIZED_NAME_ARRAY_ALLOF_DOG_PROPERTY)
private List<ArrayOfInlineAllOfArrayAllofDogPropertyInner> arrayAllofDogProperty = null;
private List<ArrayOfInlineAllOfArrayAllofDogPropertyInner> arrayAllofDogProperty = new ArrayList<>();
public ArrayOfInlineAllOf() {
}

View File

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

View File

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

View File

@ -69,7 +69,7 @@ public class Drawing {
public static final String SERIALIZED_NAME_SHAPES = "shapes";
@SerializedName(SERIALIZED_NAME_SHAPES)
private List<Shape> shapes = null;
private List<Shape> shapes = new ArrayList<>();
public Drawing() {
}

View File

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

View File

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

View File

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

View File

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

View File

@ -82,27 +82,27 @@ public class NullableClass {
public static final String SERIALIZED_NAME_ARRAY_NULLABLE_PROP = "array_nullable_prop";
@SerializedName(SERIALIZED_NAME_ARRAY_NULLABLE_PROP)
private List<Object> arrayNullableProp = null;
private List<Object> arrayNullableProp;
public static final String SERIALIZED_NAME_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop";
@SerializedName(SERIALIZED_NAME_ARRAY_AND_ITEMS_NULLABLE_PROP)
private List<Object> arrayAndItemsNullableProp = null;
private List<Object> arrayAndItemsNullableProp;
public static final String SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
@SerializedName(SERIALIZED_NAME_ARRAY_ITEMS_NULLABLE)
private List<Object> arrayItemsNullable = null;
private List<Object> arrayItemsNullable = new ArrayList<>();
public static final String SERIALIZED_NAME_OBJECT_NULLABLE_PROP = "object_nullable_prop";
@SerializedName(SERIALIZED_NAME_OBJECT_NULLABLE_PROP)
private Map<String, Object> objectNullableProp = null;
private Map<String, Object> objectNullableProp;
public static final String SERIALIZED_NAME_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop";
@SerializedName(SERIALIZED_NAME_OBJECT_AND_ITEMS_NULLABLE_PROP)
private Map<String, Object> objectAndItemsNullableProp = null;
private Map<String, Object> objectAndItemsNullableProp;
public static final String SERIALIZED_NAME_OBJECT_ITEMS_NULLABLE = "object_items_nullable";
@SerializedName(SERIALIZED_NAME_OBJECT_ITEMS_NULLABLE)
private Map<String, Object> objectItemsNullable = null;
private Map<String, Object> objectItemsNullable = new HashMap<>();
public NullableClass() {
}
@ -246,9 +246,6 @@ public class NullableClass {
}
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
if (this.arrayNullableProp == null) {
this.arrayNullableProp = null;
}
this.arrayNullableProp.add(arrayNullablePropItem);
return this;
}
@ -276,9 +273,6 @@ public class NullableClass {
}
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
if (this.arrayAndItemsNullableProp == null) {
this.arrayAndItemsNullableProp = null;
}
this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem);
return this;
}
@ -336,9 +330,6 @@ public class NullableClass {
}
public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) {
if (this.objectNullableProp == null) {
this.objectNullableProp = null;
}
this.objectNullableProp.put(key, objectNullablePropItem);
return this;
}
@ -366,9 +357,6 @@ public class NullableClass {
}
public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) {
if (this.objectAndItemsNullableProp == null) {
this.objectAndItemsNullableProp = null;
}
this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem);
return this;
}

View File

@ -66,7 +66,7 @@ public class ObjectWithDeprecatedFields {
public static final String SERIALIZED_NAME_BARS = "bars";
@SerializedName(SERIALIZED_NAME_BARS)
private List<String> bars = null;
private List<String> bars = new ArrayList<>();
public ObjectWithDeprecatedFields() {
}

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 = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store

View File

@ -46,28 +46,28 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AdditionalPropertiesClass {
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
private Map<String, String> mapString = null;
private Map<String, String> mapString;
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber;
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger;
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean;
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger;
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype;
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString;
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype;
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
private Object anytype1;
@ -88,9 +88,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = null;
}
this.mapString.put(key, mapStringItem);
return this;
}
@ -122,9 +119,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = null;
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
@ -156,9 +150,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = null;
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
@ -190,9 +181,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = null;
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
@ -224,9 +212,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = null;
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
@ -258,9 +243,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = null;
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
@ -292,9 +274,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = null;
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
@ -326,9 +305,6 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = null;
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}

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 = null;
private List<List<BigDecimal>> arrayArrayNumber;
public ArrayOfArrayOfNumberOnly() {
}
@ -47,9 +47,6 @@ public class ArrayOfArrayOfNumberOnly {
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (this.arrayArrayNumber == null) {
this.arrayArrayNumber = null;
}
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}

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 = null;
private List<BigDecimal> arrayNumber;
public ArrayOfNumberOnly() {
}
@ -47,9 +47,6 @@ public class ArrayOfNumberOnly {
}
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
if (this.arrayNumber == null) {
this.arrayNumber = null;
}
this.arrayNumber.add(arrayNumberItem);
return this;
}

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 = null;
private List<String> arrayOfString;
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger;
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
public ArrayTest() {
}
@ -55,9 +55,6 @@ public class ArrayTest {
}
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
if (this.arrayOfString == null) {
this.arrayOfString = null;
}
this.arrayOfString.add(arrayOfStringItem);
return this;
}
@ -89,9 +86,6 @@ public class ArrayTest {
}
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
if (this.arrayArrayOfInteger == null) {
this.arrayArrayOfInteger = null;
}
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
return this;
}
@ -123,9 +117,6 @@ public class ArrayTest {
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = null;
}
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
return this;
}

View File

@ -108,7 +108,7 @@ public class EnumArrays {
}
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum;
public EnumArrays() {
}
@ -146,9 +146,6 @@ public class EnumArrays {
}
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
if (this.arrayEnum == null) {
this.arrayEnum = null;
}
this.arrayEnum.add(arrayEnumItem);
return this;
}

View File

@ -39,7 +39,7 @@ public class FileSchemaTestClass {
private ModelFile _file;
public static final String JSON_PROPERTY_FILES = "files";
private List<ModelFile> files = null;
private List<ModelFile> files;
public FileSchemaTestClass() {
}
@ -77,9 +77,6 @@ public class FileSchemaTestClass {
}
public FileSchemaTestClass addFilesItem(ModelFile filesItem) {
if (this.files == null) {
this.files = null;
}
this.files.add(filesItem);
return this;
}

View File

@ -37,7 +37,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class MapTest {
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string";
private Map<String, Map<String, String>> mapMapOfString = null;
private Map<String, Map<String, String>> mapMapOfString;
/**
* Gets or Sets inner
@ -75,13 +75,13 @@ public class MapTest {
}
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString;
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap;
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap;
public MapTest() {
}
@ -93,9 +93,6 @@ public class MapTest {
}
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
if (this.mapMapOfString == null) {
this.mapMapOfString = null;
}
this.mapMapOfString.put(key, mapMapOfStringItem);
return this;
}
@ -127,9 +124,6 @@ public class MapTest {
}
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
if (this.mapOfEnumString == null) {
this.mapOfEnumString = null;
}
this.mapOfEnumString.put(key, mapOfEnumStringItem);
return this;
}
@ -161,9 +155,6 @@ public class MapTest {
}
public MapTest putDirectMapItem(String key, Boolean directMapItem) {
if (this.directMap == null) {
this.directMap = null;
}
this.directMap.put(key, directMapItem);
return this;
}
@ -195,9 +186,6 @@ public class MapTest {
}
public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
if (this.indirectMap == null) {
this.indirectMap = null;
}
this.indirectMap.put(key, indirectMapItem);
return this;
}

View File

@ -45,7 +45,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
private OffsetDateTime dateTime;
public static final String JSON_PROPERTY_MAP = "map";
private Map<String, Animal> map = null;
private Map<String, Animal> map;
public MixedPropertiesAndAdditionalPropertiesClass() {
}
@ -109,9 +109,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
}
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
if (this.map == null) {
this.map = null;
}
this.map.put(key, mapItem);
return this;
}

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