From ab69ce5dc3503960fd33761eef974f2a91c11619 Mon Sep 17 00:00:00 2001 From: Benjamin Douglas Date: Thu, 13 Apr 2017 02:37:49 -0700 Subject: [PATCH] Add null pointer check to add/put methods (#5385) (#5386) Commit e3d04ee01 (issue #5240) introduced unsafe add/put methods for optional list/map parameters. This change maintains the spirit of issue #5240 (optional containers are null by default) while still making add/put calls safe. It does this by checking for null first and, if so, initializing it with an empty container. Also updated the affected samples using the various scripts in bin/. --- .../src/main/resources/Java/pojo.mustache | 10 +++++ .../main/resources/JavaJaxRS/pojo.mustache | 10 +++++ .../resources/JavaPlayFramework/pojo.mustache | 10 +++++ .../main/resources/JavaSpring/pojo.mustache | 10 +++++ .../src/main/resources/MSF4J/pojo.mustache | 10 +++++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 10 ++++- .../model/ArrayOfArrayOfNumberOnly.java | 5 ++- .../client/model/ArrayOfNumberOnly.java | 5 ++- .../io/swagger/client/model/ArrayTest.java | 15 +++++-- .../io/swagger/client/model/EnumArrays.java | 5 ++- .../java/io/swagger/client/model/MapTest.java | 10 ++++- ...ropertiesAndAdditionalPropertiesClass.java | 5 ++- .../java/io/swagger/client/model/Pet.java | 5 ++- .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../client/model/ArrayOfNumberOnly.java | 3 ++ .../io/swagger/client/model/ArrayTest.java | 9 +++++ .../io/swagger/client/model/EnumArrays.java | 3 ++ .../java/io/swagger/client/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../java/io/swagger/client/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 10 ++++- .../model/ArrayOfArrayOfNumberOnly.java | 5 ++- .../client/model/ArrayOfNumberOnly.java | 5 ++- .../io/swagger/client/model/ArrayTest.java | 15 +++++-- .../io/swagger/client/model/EnumArrays.java | 5 ++- .../java/io/swagger/client/model/MapTest.java | 10 ++++- ...ropertiesAndAdditionalPropertiesClass.java | 5 ++- .../java/io/swagger/client/model/Pet.java | 5 ++- .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../gen/java/io/swagger/model/ArrayTest.java | 9 +++++ .../gen/java/io/swagger/model/EnumArrays.java | 3 ++ .../gen/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/gen/java/io/swagger/model/Pet.java | 3 ++ .../app/apimodels/Pet.java | 5 ++- .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../gen/java/io/swagger/model/ArrayTest.java | 9 +++++ .../gen/java/io/swagger/model/EnumArrays.java | 3 ++ .../gen/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/gen/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../gen/java/io/swagger/model/ArrayTest.java | 9 +++++ .../gen/java/io/swagger/model/EnumArrays.java | 3 ++ .../gen/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/gen/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../main/java/io/swagger/model/ArrayTest.java | 9 +++++ .../java/io/swagger/model/EnumArrays.java | 3 ++ .../main/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../main/java/io/swagger/model/ArrayTest.java | 9 +++++ .../java/io/swagger/model/EnumArrays.java | 3 ++ .../main/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../main/java/io/swagger/model/ArrayTest.java | 9 +++++ .../java/io/swagger/model/EnumArrays.java | 3 ++ .../main/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../main/java/io/swagger/model/ArrayTest.java | 9 +++++ .../java/io/swagger/model/EnumArrays.java | 3 ++ .../main/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ .../src/main/java/io/swagger/api/FakeApi.java | 4 +- .../io/swagger/api/FakeApiController.java | 40 +++++++++---------- .../src/main/java/io/swagger/api/PetApi.java | 6 +-- .../java/io/swagger/api/PetApiController.java | 8 ++-- .../model/AdditionalPropertiesClass.java | 10 ++++- .../model/ArrayOfArrayOfNumberOnly.java | 5 ++- .../io/swagger/model/ArrayOfNumberOnly.java | 5 ++- .../main/java/io/swagger/model/ArrayTest.java | 15 +++++-- .../java/io/swagger/model/EnumArrays.java | 5 ++- .../main/java/io/swagger/model/MapTest.java | 10 ++++- ...ropertiesAndAdditionalPropertiesClass.java | 5 ++- .../src/main/java/io/swagger/model/Pet.java | 5 ++- .../model/AdditionalPropertiesClass.java | 6 +++ .../model/ArrayOfArrayOfNumberOnly.java | 3 ++ .../io/swagger/model/ArrayOfNumberOnly.java | 3 ++ .../main/java/io/swagger/model/ArrayTest.java | 9 +++++ .../java/io/swagger/model/EnumArrays.java | 3 ++ .../main/java/io/swagger/model/MapTest.java | 6 +++ ...ropertiesAndAdditionalPropertiesClass.java | 3 ++ .../src/main/java/io/swagger/model/Pet.java | 3 ++ 180 files changed, 881 insertions(+), 66 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index 069b17ba9e..d6d6738c05 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -44,6 +44,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -51,6 +56,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache index 5c0cc88526..89ce4e7dd5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache @@ -40,6 +40,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -47,6 +52,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache index 27ea403181..1811924571 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/pojo.mustache @@ -38,6 +38,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -45,6 +50,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache index 90aa94b923..73464e2599 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache @@ -43,6 +43,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -50,6 +55,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/pojo.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pojo.mustache index eb1be44652..9a5582c8db 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pojo.mustache @@ -40,6 +40,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isListContainer}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.add({{name}}Item); return this; } @@ -47,6 +52,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#isMapContainer}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}; + } + {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 273ff66a90..d35dfb34b9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -39,6 +39,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -62,6 +65,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index c5eeb66b5a..01c8634bf4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 6b749b0bec..a5ce7de4b6 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index a92f45a96b..5ddd9d6bd4 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -42,6 +42,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -65,6 +68,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -88,6 +94,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index dcbb54cd3f..1adf453102 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -116,6 +116,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index 92b0d6e5b5..5243110820 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -69,6 +69,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -92,6 +95,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ab7270ac76..05749b4f3d 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -81,6 +81,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index ac99ff6663..c99528a28c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -161,6 +161,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 273ff66a90..d35dfb34b9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -39,6 +39,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -62,6 +65,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index c5eeb66b5a..01c8634bf4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 6b749b0bec..a5ce7de4b6 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java index a92f45a96b..5ddd9d6bd4 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java @@ -42,6 +42,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -65,6 +68,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -88,6 +94,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index dcbb54cd3f..1adf453102 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -116,6 +116,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index 92b0d6e5b5..5243110820 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -69,6 +69,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -92,6 +95,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ab7270ac76..05749b4f3d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -81,6 +81,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index ac99ff6663..c99528a28c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -161,6 +161,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 2ab888265d..be2c11fff7 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -39,6 +39,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -62,6 +65,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 843c806cb5..c07ad8757e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 79395899b0..48671f1134 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java index b9f244b171..3077818d0c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java @@ -42,6 +42,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -65,6 +68,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -88,6 +94,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java index 14e3162726..d28912b212 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java @@ -116,6 +116,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java index 290f98bfbf..cd9da863ad 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java @@ -69,6 +69,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -92,6 +95,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index fbd78c6a35..888178fc6a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -81,6 +81,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java index 1611a840cb..d48d60ddef 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java @@ -161,6 +161,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 273ff66a90..d35dfb34b9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -39,6 +39,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -62,6 +65,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index c5eeb66b5a..01c8634bf4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 6b749b0bec..a5ce7de4b6 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java index a92f45a96b..5ddd9d6bd4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java @@ -42,6 +42,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -65,6 +68,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -88,6 +94,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index dcbb54cd3f..1adf453102 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -116,6 +116,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index 92b0d6e5b5..5243110820 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -69,6 +69,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -92,6 +95,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d422e60df5..c6488007e1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -81,6 +81,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index ac99ff6663..c99528a28c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -161,6 +161,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 273ff66a90..d35dfb34b9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -39,6 +39,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -62,6 +65,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index c5eeb66b5a..01c8634bf4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 6b749b0bec..a5ce7de4b6 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -36,6 +36,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java index a92f45a96b..5ddd9d6bd4 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -42,6 +42,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -65,6 +68,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -88,6 +94,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index dcbb54cd3f..1adf453102 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -116,6 +116,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index 92b0d6e5b5..5243110820 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -69,6 +69,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -92,6 +95,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ab7270ac76..05749b4f3d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -81,6 +81,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index ac99ff6663..c99528a28c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -161,6 +161,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 2bd4852e8e..aacc588cc4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -29,10 +29,10 @@ import android.os.Parcel; public class AdditionalPropertiesClass implements Parcelable { @SerializedName("map_property") - private Map mapProperty = new HashMap(); + private Map mapProperty = null; @SerializedName("map_of_map_property") - private Map> mapOfMapProperty = new HashMap>(); + private Map> mapOfMapProperty = null; public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -40,6 +40,9 @@ public class AdditionalPropertiesClass implements Parcelable { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -63,6 +66,9 @@ public class AdditionalPropertiesClass implements Parcelable { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 6c98580df1..a43774eba7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,7 +29,7 @@ import android.os.Parcel; public class ArrayOfArrayOfNumberOnly implements Parcelable { @SerializedName("ArrayArrayNumber") - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -37,6 +37,9 @@ public class ArrayOfArrayOfNumberOnly implements Parcelable { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index faf67248e5..fe09adb2fa 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -29,7 +29,7 @@ import android.os.Parcel; public class ArrayOfNumberOnly implements Parcelable { @SerializedName("ArrayNumber") - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -37,6 +37,9 @@ public class ArrayOfNumberOnly implements Parcelable { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java index 3e34712b7e..9d9cfcb7ed 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java @@ -29,13 +29,13 @@ import android.os.Parcel; public class ArrayTest implements Parcelable { @SerializedName("array_of_string") - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; @SerializedName("array_array_of_integer") - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; @SerializedName("array_array_of_model") - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -43,6 +43,9 @@ public class ArrayTest implements Parcelable { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -66,6 +69,9 @@ public class ArrayTest implements Parcelable { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -89,6 +95,9 @@ public class ArrayTest implements Parcelable { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java index 8f0ed50d7c..593272046e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java @@ -75,7 +75,7 @@ public class EnumArrays implements Parcelable { } @SerializedName("array_enum") - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -101,6 +101,9 @@ public class EnumArrays implements Parcelable { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java index eda550e267..f224e8523d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java @@ -29,7 +29,7 @@ import android.os.Parcel; public class MapTest implements Parcelable { @SerializedName("map_map_of_string") - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -54,7 +54,7 @@ public class MapTest implements Parcelable { } @SerializedName("map_of_enum_string") - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -62,6 +62,9 @@ public class MapTest implements Parcelable { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -85,6 +88,9 @@ public class MapTest implements Parcelable { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 455c022291..2dd03e0892 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -38,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { private DateTime dateTime = null; @SerializedName("map") - private Map map = new HashMap(); + private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -82,6 +82,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java index 43c61fae2b..85184e4d88 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java @@ -42,7 +42,7 @@ public class Pet implements Parcelable { private List photoUrls = new ArrayList(); @SerializedName("tags") - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -155,6 +155,9 @@ public class Pet implements Parcelable { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 66ee977636..3d8eb14d9b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -38,6 +38,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -61,6 +64,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 576303f730..35fb30470e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index ca61921ce7..f89e6b2342 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java index 4d0efb12d8..48d1a9df8c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java @@ -41,6 +41,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -64,6 +67,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -87,6 +93,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java index ce5324046b..eab37afb32 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java @@ -99,6 +99,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java index 51d8e3c972..15e118df88 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java @@ -60,6 +60,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -83,6 +86,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4116a2f7bb..c94ff2a118 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,6 +80,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index 2d5d7b1275..64b70ed7c5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 66ee977636..3d8eb14d9b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -38,6 +38,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -61,6 +64,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 576303f730..35fb30470e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index ca61921ce7..f89e6b2342 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java index 4d0efb12d8..48d1a9df8c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java @@ -41,6 +41,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -64,6 +67,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -87,6 +93,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java index ce5324046b..eab37afb32 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java @@ -99,6 +99,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java index 51d8e3c972..15e118df88 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java @@ -60,6 +60,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -83,6 +86,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4116a2f7bb..c94ff2a118 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,6 +80,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index 2d5d7b1275..64b70ed7c5 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 03837fb158..cc69fde91a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -40,6 +40,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -63,6 +66,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index cc275b3f84..fce599722f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 7b9446e87e..53eb740332 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java index b2499011c0..0211f83a67 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java @@ -43,6 +43,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -66,6 +69,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -89,6 +95,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index 818cb02f2f..9222aafcf3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -117,6 +117,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 080b506dea..cd4cf9f2dd 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -70,6 +70,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -93,6 +96,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c3a282bf93..9f442e3ab0 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -82,6 +82,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index 1e792023f9..34761af300 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -164,6 +164,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 66ee977636..3d8eb14d9b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -38,6 +38,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -61,6 +64,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 576303f730..35fb30470e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index ca61921ce7..f89e6b2342 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 4d0efb12d8..48d1a9df8c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -41,6 +41,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -64,6 +67,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -87,6 +93,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java index ce5324046b..eab37afb32 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -99,6 +99,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java index 51d8e3c972..15e118df88 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -60,6 +60,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -83,6 +86,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4116a2f7bb..c94ff2a118 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,6 +80,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index 2d5d7b1275..64b70ed7c5 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 66ee977636..3d8eb14d9b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -38,6 +38,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -61,6 +64,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 576303f730..35fb30470e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index ca61921ce7..f89e6b2342 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -35,6 +35,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 4d0efb12d8..48d1a9df8c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -41,6 +41,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -64,6 +67,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -87,6 +93,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java index ce5324046b..eab37afb32 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -99,6 +99,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java index 51d8e3c972..15e118df88 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -60,6 +60,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -83,6 +86,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4116a2f7bb..c94ff2a118 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -80,6 +80,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index 2d5d7b1275..64b70ed7c5 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7643088bc1..3d8eb14d9b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -27,10 +27,10 @@ import java.util.Map; public class AdditionalPropertiesClass { @SerializedName("map_property") - private Map mapProperty = new HashMap(); + private Map mapProperty = null; @SerializedName("map_of_map_property") - private Map> mapOfMapProperty = new HashMap>(); + private Map> mapOfMapProperty = null; public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -38,6 +38,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -61,6 +64,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index fbc5eef2f7..35fb30470e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ import java.util.List; public class ArrayOfArrayOfNumberOnly { @SerializedName("ArrayArrayNumber") - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -35,6 +35,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 47e816f633..f89e6b2342 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ import java.util.List; public class ArrayOfNumberOnly { @SerializedName("ArrayNumber") - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -35,6 +35,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java index 39008027e2..48d1a9df8c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -27,13 +27,13 @@ import java.util.List; public class ArrayTest { @SerializedName("array_of_string") - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; @SerializedName("array_array_of_integer") - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; @SerializedName("array_array_of_model") - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -41,6 +41,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -64,6 +67,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -87,6 +93,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java index 68e8f21eb2..eab37afb32 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -73,7 +73,7 @@ public class EnumArrays { } @SerializedName("array_enum") - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -99,6 +99,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java index a03d25c6d1..15e118df88 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java @@ -27,7 +27,7 @@ import java.util.Map; public class MapTest { @SerializedName("map_map_of_string") - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -52,7 +52,7 @@ public class MapTest { } @SerializedName("map_of_enum_string") - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -60,6 +60,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -83,6 +86,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 13487e7e35..c94ff2a118 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { private DateTime dateTime = null; @SerializedName("map") - private Map map = new HashMap(); + private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -80,6 +80,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java index 8b330f6ebb..64b70ed7c5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java @@ -40,7 +40,7 @@ public class Pet { private List photoUrls = new ArrayList(); @SerializedName("tags") - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java index c666cf2103..159b993ed3 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java index c666cf2103..159b993ed3 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java @@ -153,6 +153,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 488f1acade..789fe0cd3c 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f914ff03eb..37112db97e 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 457d8ffc54..690c5841b5 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayTest.java index 4df8614f41..db67fc5a92 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumArrays.java index 7f3efbc690..55358c076b 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MapTest.java index 89af83736c..1ff2f59e99 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index fad1ab502c..b784a93830 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Pet.java index bbaacde9ee..dbbf22e859 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/io/swagger/model/Pet.java @@ -150,6 +150,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index e274b14fa5..9de0da0d58 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -25,7 +25,7 @@ public class Pet { private List photoUrls = new ArrayList(); @JsonProperty("tags") - private List tags; + private List tags = null; /** * pet status in the store @@ -144,6 +144,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index bf988ba5d4..e945e61897 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -40,6 +40,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -64,6 +67,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 9df3539b9e..96ec13ad4f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 80afcc9c40..e04487ba65 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java index 3b5e777759..6e391addfe 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java @@ -43,6 +43,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -67,6 +70,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -91,6 +97,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java index f4f55cd1d6..a4fa1efac8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java @@ -121,6 +121,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java index 6d815004b2..c1625ac70b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java @@ -72,6 +72,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -96,6 +99,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 13ef25885b..85064283e4 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -84,6 +84,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java index 6d7174ae3e..dee942d257 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java @@ -170,6 +170,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index bf988ba5d4..e945e61897 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -40,6 +40,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -64,6 +67,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 9df3539b9e..96ec13ad4f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 80afcc9c40..e04487ba65 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -37,6 +37,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java index 3b5e777759..6e391addfe 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java @@ -43,6 +43,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -67,6 +70,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -91,6 +97,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java index f4f55cd1d6..a4fa1efac8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java @@ -121,6 +121,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java index 6d815004b2..c1625ac70b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java @@ -72,6 +72,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -96,6 +99,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 13ef25885b..85064283e4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -84,6 +84,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java index 6d7174ae3e..dee942d257 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java @@ -170,6 +170,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index d05e148df5..f4cfcadae5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f60805cc02..8f975d8fed 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index d4f0f5010e..2c55600855 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java index 10c4c6c646..664e319cd3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java index 06bb785ce0..f904035e48 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java index 9b6fc7acef..434c3a8f1b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 93ec3584fa..727205e40f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java index 566cbc43a6..b013846b4d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index d05e148df5..f4cfcadae5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f60805cc02..8f975d8fed 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index d4f0f5010e..2c55600855 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java index 10c4c6c646..664e319cd3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java index 06bb785ce0..f904035e48 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java index 9b6fc7acef..434c3a8f1b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 66e8b53b9b..dba1241f6d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java index 566cbc43a6..b013846b4d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index d05e148df5..f4cfcadae5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f60805cc02..8f975d8fed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index d4f0f5010e..2c55600855 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java index 10c4c6c646..664e319cd3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java index 06bb785ce0..f904035e48 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java index 9b6fc7acef..434c3a8f1b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 93ec3584fa..727205e40f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java index 566cbc43a6..b013846b4d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index d05e148df5..f4cfcadae5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f60805cc02..8f975d8fed 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index d4f0f5010e..2c55600855 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java index 10c4c6c646..664e319cd3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java index 06bb785ce0..f904035e48 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java index 9b6fc7acef..434c3a8f1b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 66e8b53b9b..dba1241f6d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java index 566cbc43a6..b013846b4d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java index 2d94861f66..602c5a1066 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -48,7 +48,7 @@ public interface FakeApi { produces = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, consumes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string,@ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password,@ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback); @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake", }) @@ -62,6 +62,6 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "*/*" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "NUMBER_1, NUMBER_MINUS_2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)" , allowableValues="NUMBER_1_DOT_1, NUMBER_MINUS_1_DOT_2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); + ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java index 33ebb6847d..c4d23c4420 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApiController.java @@ -31,30 +31,30 @@ public class FakeApiController implements FakeApi { return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true ) @RequestPart(value="number", required=true) BigDecimal number, - @ApiParam(value = "None", required=true ) @RequestPart(value="double", required=true) Double _double, - @ApiParam(value = "None", required=true ) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, - @ApiParam(value = "None", required=true ) @RequestPart(value="byte", required=true) byte[] _byte, - @ApiParam(value = "None" ) @RequestPart(value="integer", required=false) Integer integer, - @ApiParam(value = "None" ) @RequestPart(value="int32", required=false) Integer int32, - @ApiParam(value = "None" ) @RequestPart(value="int64", required=false) Long int64, - @ApiParam(value = "None" ) @RequestPart(value="float", required=false) Float _float, - @ApiParam(value = "None" ) @RequestPart(value="string", required=false) String string, - @ApiParam(value = "None" ) @RequestPart(value="binary", required=false) byte[] binary, - @ApiParam(value = "None" ) @RequestPart(value="date", required=false) LocalDate date, - @ApiParam(value = "None" ) @RequestPart(value="dateTime", required=false) DateTime dateTime, - @ApiParam(value = "None" ) @RequestPart(value="password", required=false) String password, - @ApiParam(value = "None" ) @RequestPart(value="callback", required=false) String paramCallback) { + public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number, + @ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double, + @ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter, + @ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte, + @ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer, + @ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32, + @ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64, + @ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float, + @ApiParam(value = "None") @RequestPart(value="string", required=false) String string, + @ApiParam(value = "None") @RequestPart(value="binary", required=false) byte[] binary, + @ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date, + @ApiParam(value = "None") @RequestPart(value="dateTime", required=false) DateTime dateTime, + @ApiParam(value = "None") @RequestPart(value="password", required=false) String password, + @ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "NUMBER_1, NUMBER_MINUS_2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)" , allowableValues="NUMBER_1_DOT_1, NUMBER_MINUS_1_DOT_2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { + public ResponseEntity testEnumParameters(@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues="1.1, -1.2") @RequestPart(value="enum_query_double", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java index deb708121c..3c7e400b4a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -71,7 +71,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List status); @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -143,7 +143,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status); @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @@ -161,6 +161,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java index b7c01ba2f0..1cd8ee75e4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java @@ -35,7 +35,7 @@ public class PetApiController implements PetApi { return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @RequestParam(value = "status", required = true) List status) { // do some magic! return new ResponseEntity>(HttpStatus.OK); } @@ -56,14 +56,14 @@ public class PetApiController implements PetApi { } public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, - @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { + @ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name, + @ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { // do some magic! return new ResponseEntity(HttpStatus.OK); } public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, + @ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! return new ResponseEntity(HttpStatus.OK); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 81535e041f..f4cfcadae5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -15,10 +15,10 @@ import javax.validation.constraints.*; public class AdditionalPropertiesClass { @JsonProperty("map_property") - private Map mapProperty = new HashMap(); + private Map mapProperty = null; @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = new HashMap>(); + private Map> mapOfMapProperty = null; public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 3be691e4d9..8f975d8fed 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -15,7 +15,7 @@ import javax.validation.constraints.*; public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = new ArrayList>(); + private List> arrayArrayNumber = null; public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 1219689734..2c55600855 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -15,7 +15,7 @@ import javax.validation.constraints.*; public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") - private List arrayNumber = new ArrayList(); + private List arrayNumber = null; public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java index a26a160028..664e319cd3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java @@ -15,13 +15,13 @@ import javax.validation.constraints.*; public class ArrayTest { @JsonProperty("array_of_string") - private List arrayOfString = new ArrayList(); + private List arrayOfString = null; @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = new ArrayList>(); + private List> arrayArrayOfInteger = null; @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = new ArrayList>(); + private List> arrayArrayOfModel = null; public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java index 97ab6f6410..f904035e48 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java @@ -80,7 +80,7 @@ public class EnumArrays { } @JsonProperty("array_enum") - private List arrayEnum = new ArrayList(); + private List arrayEnum = null; public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java index 9a0566a8dd..434c3a8f1b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java @@ -16,7 +16,7 @@ import javax.validation.constraints.*; public class MapTest { @JsonProperty("map_map_of_string") - private Map> mapMapOfString = new HashMap>(); + private Map> mapMapOfString = null; /** * Gets or Sets inner @@ -50,7 +50,7 @@ public class MapTest { } @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = new HashMap(); + private Map mapOfEnumString = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2cb9928d5f..dba1241f6d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -24,7 +24,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { private DateTime dateTime = null; @JsonProperty("map") - private Map map = new HashMap(); + private Map map = null; public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java index 9adc708de7..b013846b4d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java @@ -29,7 +29,7 @@ public class Pet { private List photoUrls = new ArrayList(); @JsonProperty("tags") - private List tags = new ArrayList(); + private List tags = null; /** * pet status in the store @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index d05e148df5..f4cfcadae5 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -26,6 +26,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); + } this.mapProperty.put(key, mapPropertyItem); return this; } @@ -49,6 +52,9 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); + } this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index f60805cc02..8f975d8fed 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfArrayOfNumberOnly { } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index d4f0f5010e..2c55600855 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,9 @@ public class ArrayOfNumberOnly { } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } this.arrayNumber.add(arrayNumberItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java index 10c4c6c646..664e319cd3 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java @@ -29,6 +29,9 @@ public class ArrayTest { } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } this.arrayOfString.add(arrayOfStringItem); return this; } @@ -52,6 +55,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } @@ -75,6 +81,9 @@ public class ArrayTest { } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java index 06bb785ce0..f904035e48 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java @@ -106,6 +106,9 @@ public class EnumArrays { } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } this.arrayEnum.add(arrayEnumItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java index 9b6fc7acef..434c3a8f1b 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java @@ -58,6 +58,9 @@ public class MapTest { } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } this.mapMapOfString.put(key, mapMapOfStringItem); return this; } @@ -81,6 +84,9 @@ public class MapTest { } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 66e8b53b9b..dba1241f6d 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -68,6 +68,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } this.map.put(key, mapItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java index 566cbc43a6..b013846b4d 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java @@ -152,6 +152,9 @@ public class Pet { } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } this.tags.add(tagsItem); return this; }