diff --git a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache index 174a9a0064d..2203cc43150 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache @@ -80,7 +80,7 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } // validate the required field `{{{baseName}}}` (array) for (const item of data['{{{baseName}}}']) { - {{{items.dataType}}}.validateJsonObject(item); + {{{items.dataType}}}.validateJSON(item); }; {{/isRequired}} {{^isRequired}} @@ -91,7 +91,7 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } // validate the optional field `{{{baseName}}}` (array) for (const item of data['{{{baseName}}}']) { - {{{items.dataType}}}.validateJsonObject(item); + {{{items.dataType}}}.validateJSON(item); }; } {{/isRequired}} diff --git a/samples/client/petstore/javascript-apollo/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-apollo/src/model/FileSchemaTestClass.js index 8174d56245f..1b343c6835b 100644 --- a/samples/client/petstore/javascript-apollo/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-apollo/src/model/FileSchemaTestClass.js @@ -74,7 +74,7 @@ class FileSchemaTestClass { } // validate the optional field `files` (array) for (const item of data['files']) { - File.validateJsonObject(item); + File.validateJSON(item); }; } diff --git a/samples/client/petstore/javascript-apollo/src/model/Pet.js b/samples/client/petstore/javascript-apollo/src/model/Pet.js index cc5239c6a17..f1236e6dd26 100644 --- a/samples/client/petstore/javascript-apollo/src/model/Pet.js +++ b/samples/client/petstore/javascript-apollo/src/model/Pet.js @@ -106,7 +106,7 @@ class Pet { } // validate the optional field `tags` (array) for (const item of data['tags']) { - Tag.validateJsonObject(item); + Tag.validateJSON(item); }; } // ensure the json data is a string diff --git a/samples/client/petstore/javascript-es6/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-es6/src/model/FileSchemaTestClass.js index 8174d56245f..1b343c6835b 100644 --- a/samples/client/petstore/javascript-es6/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-es6/src/model/FileSchemaTestClass.js @@ -74,7 +74,7 @@ class FileSchemaTestClass { } // validate the optional field `files` (array) for (const item of data['files']) { - File.validateJsonObject(item); + File.validateJSON(item); }; } diff --git a/samples/client/petstore/javascript-es6/src/model/Pet.js b/samples/client/petstore/javascript-es6/src/model/Pet.js index cc5239c6a17..f1236e6dd26 100644 --- a/samples/client/petstore/javascript-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-es6/src/model/Pet.js @@ -106,7 +106,7 @@ class Pet { } // validate the optional field `tags` (array) for (const item of data['tags']) { - Tag.validateJsonObject(item); + Tag.validateJSON(item); }; } // ensure the json data is a string diff --git a/samples/client/petstore/javascript-promise-es6/src/model/FileSchemaTestClass.js b/samples/client/petstore/javascript-promise-es6/src/model/FileSchemaTestClass.js index 8174d56245f..1b343c6835b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/FileSchemaTestClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/FileSchemaTestClass.js @@ -74,7 +74,7 @@ class FileSchemaTestClass { } // validate the optional field `files` (array) for (const item of data['files']) { - File.validateJsonObject(item); + File.validateJSON(item); }; } diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js index cc5239c6a17..f1236e6dd26 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js @@ -106,7 +106,7 @@ class Pet { } // validate the optional field `tags` (array) for (const item of data['tags']) { - Tag.validateJsonObject(item); + Tag.validateJSON(item); }; } // ensure the json data is a string diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 40e0c01aed6..d50897ade06 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -22,14 +22,14 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("AdditionalPropertiesClass") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = null; - private @Valid Map mapNumber = null; - private @Valid Map mapInteger = null; - private @Valid Map mapBoolean = null; - private @Valid Map> mapArrayInteger = null; - private @Valid Map> mapArrayAnytype = null; - private @Valid Map> mapMapString = null; - private @Valid Map> mapMapAnytype = null; + private @Valid Map mapString = new HashMap<>(); + private @Valid Map mapNumber = new HashMap<>(); + private @Valid Map mapInteger = new HashMap<>(); + private @Valid Map mapBoolean = new HashMap<>(); + private @Valid Map> mapArrayInteger = new HashMap<>(); + private @Valid Map> mapArrayAnytype = new HashMap<>(); + private @Valid Map> mapMapString = new HashMap<>(); + private @Valid Map> mapMapAnytype = new HashMap<>(); private @Valid Object anytype1; private @Valid Object anytype2; private @Valid Object anytype3; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 65e80c567bc..d3f4815dfd4 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfArrayOfNumberOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfArrayOfNumberOnly implements Serializable { - private @Valid List> arrayArrayNumber = null; + private @Valid List> arrayArrayNumber = new ArrayList<>(); protected ArrayOfArrayOfNumberOnly(ArrayOfArrayOfNumberOnlyBuilder b) { this.arrayArrayNumber = b.arrayArrayNumber; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index e74a6617845..5d1799d12cb 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayOfNumberOnly") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayOfNumberOnly implements Serializable { - private @Valid List arrayNumber = null; + private @Valid List arrayNumber = new ArrayList<>(); protected ArrayOfNumberOnly(ArrayOfNumberOnlyBuilder b) { this.arrayNumber = b.arrayNumber; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java index 70c1ab60258..a40e73fdd5e 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/ArrayTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("ArrayTest") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class ArrayTest implements Serializable { - private @Valid List arrayOfString = null; - private @Valid List> arrayArrayOfInteger = null; - private @Valid List> arrayArrayOfModel = null; + private @Valid List arrayOfString = new ArrayList<>(); + private @Valid List> arrayArrayOfInteger = new ArrayList<>(); + private @Valid List> arrayArrayOfModel = new ArrayList<>(); protected ArrayTest(ArrayTestBuilder b) { this.arrayOfString = b.arrayOfString; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java index 03069627494..4bc6f6c1b8d 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/EnumArrays.java @@ -115,7 +115,7 @@ public class EnumArrays implements Serializable { } } - private @Valid List arrayEnum = null; + private @Valid List arrayEnum = new ArrayList<>(); protected EnumArrays(EnumArraysBuilder b) { this.justSymbol = b.justSymbol; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 14d58e3e3d5..60a19b11f1b 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FileSchemaTestClass implements Serializable { private @Valid ModelFile _file; - private @Valid List files = null; + private @Valid List files = new ArrayList<>(); protected FileSchemaTestClass(FileSchemaTestClassBuilder b) { this._file = b._file; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java index 9eb62b626f2..96271afa1ce 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MapTest.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; @JsonTypeName("MapTest") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class MapTest implements Serializable { - private @Valid Map> mapMapOfString = null; + private @Valid Map> mapMapOfString = new HashMap<>(); public enum InnerEnum { UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); @@ -68,9 +68,9 @@ public class MapTest implements Serializable { } } - private @Valid Map mapOfEnumString = null; - private @Valid Map directMap = null; - private @Valid Map indirectMap = null; + private @Valid Map mapOfEnumString = new HashMap<>(); + private @Valid Map directMap = new HashMap<>(); + private @Valid Map indirectMap = new HashMap<>(); protected MapTest(MapTestBuilder b) { this.mapMapOfString = b.mapMapOfString; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7d72e6ba39f..6e5d8d9d466 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid; private @Valid Date dateTime; - private @Valid Map map = null; + private @Valid Map map = new HashMap<>(); protected MixedPropertiesAndAdditionalPropertiesClass(MixedPropertiesAndAdditionalPropertiesClassBuilder b) { this.uuid = b.uuid; diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java index c273059826c..724992ffb63 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/Pet.java @@ -29,7 +29,7 @@ public class Pet implements Serializable { private @Valid Category category; private @Valid String name; private @Valid Set photoUrls = new LinkedHashSet<>(); - private @Valid List tags = null; + private @Valid List tags = new ArrayList<>(); public enum StatusEnum { AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); diff --git a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java index d119b26c375..cfc0fd1baba 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-jakarta/src/gen/java/org/openapitools/model/XmlItem.java @@ -25,31 +25,31 @@ public class XmlItem implements Serializable { private @Valid BigDecimal attributeNumber; private @Valid Integer attributeInteger; private @Valid Boolean attributeBoolean; - private @Valid List wrappedArray = null; + private @Valid List wrappedArray = new ArrayList<>(); private @Valid String nameString; private @Valid BigDecimal nameNumber; private @Valid Integer nameInteger; private @Valid Boolean nameBoolean; - private @Valid List nameArray = null; - private @Valid List nameWrappedArray = null; + private @Valid List nameArray = new ArrayList<>(); + private @Valid List nameWrappedArray = new ArrayList<>(); private @Valid String prefixString; private @Valid BigDecimal prefixNumber; private @Valid Integer prefixInteger; private @Valid Boolean prefixBoolean; - private @Valid List prefixArray = null; - private @Valid List prefixWrappedArray = null; + private @Valid List prefixArray = new ArrayList<>(); + private @Valid List prefixWrappedArray = new ArrayList<>(); private @Valid String namespaceString; private @Valid BigDecimal namespaceNumber; private @Valid Integer namespaceInteger; private @Valid Boolean namespaceBoolean; - private @Valid List namespaceArray = null; - private @Valid List namespaceWrappedArray = null; + private @Valid List namespaceArray = new ArrayList<>(); + private @Valid List namespaceWrappedArray = new ArrayList<>(); private @Valid String prefixNsString; private @Valid BigDecimal prefixNsNumber; private @Valid Integer prefixNsInteger; private @Valid Boolean prefixNsBoolean; - private @Valid List prefixNsArray = null; - private @Valid List prefixNsWrappedArray = null; + private @Valid List prefixNsArray = new ArrayList<>(); + private @Valid List prefixNsWrappedArray = new ArrayList<>(); protected XmlItem(XmlItemBuilder b) { this.attributeString = b.attributeString;