From d93b9e403af02cbdb92dad980618ba7c14453afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Brilhante?= Date: Sat, 28 Sep 2024 22:28:00 +0200 Subject: [PATCH] [java][resttemplate] Fix model combining properties and additional properties --- .../codegen/languages/JavaClientCodegen.java | 8 + .../additional_properties.mustache | 45 ++ .../libraries/resttemplate/model.mustache | 78 +++ .../Java/libraries/resttemplate/pojo.mustache | 612 ++++++++++++++++++ .../org/openapitools/client/model/Bird.java | 1 + .../openapitools/client/model/Category.java | 1 + .../openapitools/client/model/DataQuery.java | 11 - .../client/model/DefaultValue.java | 1 + .../client/model/NumberPropertiesOnly.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Query.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../TestFormObjectMultipartRequestMarker.java | 1 + ...deTrueObjectAllOfQueryObjectParameter.java | 1 + ...deTrueArrayStringQueryObjectParameter.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../openapitools/client/model/Category.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + .../org/openapitools/client/model/User.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../client/model/AllOfWithSingleRef.java | 1 + .../org/openapitools/client/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../client/model/ArrayOfNumberOnly.java | 1 + .../openapitools/client/model/ArrayTest.java | 1 + .../client/model/Capitalization.java | 1 + .../org/openapitools/client/model/Cat.java | 11 - .../openapitools/client/model/Category.java | 1 + .../client/model/ChildWithNullable.java | 11 - .../openapitools/client/model/ClassModel.java | 1 + .../org/openapitools/client/model/Client.java | 1 + .../client/model/DeprecatedObject.java | 1 + .../org/openapitools/client/model/Dog.java | 11 - .../openapitools/client/model/EnumArrays.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../model/FakeBigDecimalMap200Response.java | 1 + .../client/model/FileSchemaTestClass.java | 1 + .../org/openapitools/client/model/Foo.java | 1 + .../client/model/FooGetDefaultResponse.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/HealthCheckResult.java | 1 + .../openapitools/client/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../openapitools/client/model/ModelFile.java | 1 + .../openapitools/client/model/ModelList.java | 1 + .../client/model/ModelReturn.java | 1 + .../org/openapitools/client/model/Name.java | 1 + .../client/model/NullableClass.java | 57 +- .../openapitools/client/model/NumberOnly.java | 1 + .../model/ObjectWithDeprecatedFields.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../client/model/OuterComposite.java | 1 + .../model/OuterObjectWithEnumProperty.java | 1 + .../client/model/ParentWithNullable.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../client/model/ReadOnlyFirst.java | 1 + .../client/model/SpecialModelName.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + ...neFreeformAdditionalPropertiesRequest.java | 59 +- .../org/openapitools/client/model/User.java | 1 + .../model/AdditionalPropertiesClass.java | 1 + .../client/model/AllOfWithSingleRef.java | 1 + .../org/openapitools/client/model/Animal.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../client/model/ArrayOfNumberOnly.java | 1 + .../openapitools/client/model/ArrayTest.java | 1 + .../client/model/Capitalization.java | 1 + .../org/openapitools/client/model/Cat.java | 11 - .../openapitools/client/model/Category.java | 1 + .../client/model/ChildWithNullable.java | 11 - .../openapitools/client/model/ClassModel.java | 1 + .../org/openapitools/client/model/Client.java | 1 + .../client/model/DeprecatedObject.java | 1 + .../org/openapitools/client/model/Dog.java | 11 - .../openapitools/client/model/EnumArrays.java | 1 + .../openapitools/client/model/EnumTest.java | 1 + .../model/FakeBigDecimalMap200Response.java | 1 + .../client/model/FileSchemaTestClass.java | 1 + .../org/openapitools/client/model/Foo.java | 1 + .../client/model/FooGetDefaultResponse.java | 1 + .../openapitools/client/model/FormatTest.java | 1 + .../client/model/HasOnlyReadOnly.java | 1 + .../client/model/HealthCheckResult.java | 1 + .../openapitools/client/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../openapitools/client/model/ModelFile.java | 1 + .../openapitools/client/model/ModelList.java | 1 + .../client/model/ModelReturn.java | 1 + .../org/openapitools/client/model/Name.java | 1 + .../client/model/NullableClass.java | 58 +- .../openapitools/client/model/NumberOnly.java | 1 + .../model/ObjectWithDeprecatedFields.java | 1 + .../org/openapitools/client/model/Order.java | 1 + .../client/model/OuterComposite.java | 1 + .../model/OuterObjectWithEnumProperty.java | 1 + .../client/model/ParentWithNullable.java | 1 + .../org/openapitools/client/model/Pet.java | 1 + .../client/model/ReadOnlyFirst.java | 1 + .../client/model/SpecialModelName.java | 1 + .../org/openapitools/client/model/Tag.java | 1 + ...neFreeformAdditionalPropertiesRequest.java | 60 +- .../org/openapitools/client/model/User.java | 1 + 121 files changed, 1057 insertions(+), 103 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 8239da1fd6bd5..c0739aa9c56a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -583,6 +583,14 @@ public void processOpts() { } else if (RESTTEMPLATE.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java")); + + // Composed schemas can have the 'additionalProperties' keyword, as specified in JSON schema. + // In principle, this should be enabled by default for all code generators. However due to limitations + // in other code generators, support needs to be enabled on a case-by-case basis. + // The flag below should be set for all Java libraries, but the templates need to be ported + // one by one for each library. + supportsAdditionalPropertiesWithComposedSchema = true; + } else if (WEBCLIENT.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (RESTCLIENT.equals(getLibrary())) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache new file mode 100644 index 0000000000000..8e7182792457c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache @@ -0,0 +1,45 @@ +{{#additionalPropertiesType}} + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public {{classname}} putAdditionalProperty(String key, {{{.}}} value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public {{{.}}} getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } +{{/additionalPropertiesType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/model.mustache new file mode 100644 index 0000000000000..108748f607e3b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/model.mustache @@ -0,0 +1,78 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{#models}} +{{#model}} +{{#additionalPropertiesType}} +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +{{/additionalPropertiesType}} +{{/model}} +{{/models}} +import java.util.Objects; +import java.util.Arrays; +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{#vendorExtensions.x-has-readonly-properties}} +import com.fasterxml.jackson.annotation.JsonCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jackson}} +{{#withXml}} +import {{javaxPackage}}.xml.bind.annotation.*; +import {{javaxPackage}}.xml.bind.annotation.adapters.*; +import io.github.threetenjaxb.core.*; +{{/withXml}} +{{#jsonb}} +import java.lang.reflect.Type; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{javaxPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{javaxPackage}}.json.bind.serializer.DeserializationContext; +import {{javaxPackage}}.json.bind.serializer.JsonbDeserializer; +import {{javaxPackage}}.json.bind.serializer.JsonbSerializer; +import {{javaxPackage}}.json.bind.serializer.SerializationContext; +import {{javaxPackage}}.json.stream.JsonGenerator; +import {{javaxPackage}}.json.stream.JsonParser; +import {{javaxPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{javaxPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import {{javaxPackage}}.validation.constraints.*; +import {{javaxPackage}}.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} +{{#supportUrlQuery}} +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.StringJoiner; +{{/supportUrlQuery}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#vendorExtensions.x-is-one-of-interface}}{{>oneof_interface}}{{/vendorExtensions.x-is-one-of-interface}}{{^vendorExtensions.x-is-one-of-interface}}{{>pojo}}{{/vendorExtensions.x-is-one-of-interface}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache new file mode 100644 index 0000000000000..e186b58b1f210 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache @@ -0,0 +1,612 @@ +/** + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * @deprecated{{/isDeprecated}} + */{{#isDeprecated}} +@Deprecated{{/isDeprecated}} +{{#swagger1AnnotationLibrary}} +{{#description}} +@ApiModel(description = "{{{.}}}") +{{/description}} +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} +{{#description}} +@Schema(description = "{{{.}}}") +{{/description}} +{{/swagger2AnnotationLibrary}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{#isClassnameSanitized}} +{{^hasDiscriminatorWithNonEmptyMapping}} +@JsonTypeName("{{name}}") +{{/hasDiscriminatorWithNonEmptyMapping}} +{{/isClassnameSanitized}} +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +{{#serializableModel}} + private static final long serialVersionUID = 1L; + +{{/serializableModel}} + {{#vars}} + {{#isEnum}} + {{^isContainer}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#withXml}} + @Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{#isXmlWrapped}} + @XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}}) + {{/isXmlWrapped}} + {{^isXmlAttribute}} + {{#isDateTime}} + @XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class) + {{/isDateTime}} + {{/isXmlAttribute}} + {{/withXml}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#vendorExtensions.x-field-extra-annotation}} + {{{vendorExtensions.x-field-extra-annotation}}} + {{/vendorExtensions.x-field-extra-annotation}} + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined(); + {{/isContainer}} + {{^isContainer}} + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{#isContainer}} + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{^isContainer}} + {{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + public {{classname}}() { + {{#parent}} + {{#parcelableModel}} + super();{{/parcelableModel}} + {{/parent}} + {{#gson}} + {{#discriminator}} + {{#discriminator.isEnum}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator.isEnum}} + {{/discriminator}} + {{/gson}} + } + {{#vendorExtensions.x-has-readonly-properties}} + {{^withXml}} + /** + * Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}} + */ + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + this(); + {{#readOnlyVars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; + {{/readOnlyVars}} + } + {{/withXml}} + {{/vendorExtensions.x-has-readonly-properties}} +{{#vendorExtensions.x-java-all-args-constructor}} + + /** + * Constructor with all args parameters + */ + public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) { +{{#parent}} + super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}}); +{{/parent}} + {{#vars}} + this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}}; +{{/vars}} + } +{{/vendorExtensions.x-java-all-args-constructor}} + +{{#vars}} + {{^isReadOnly}} + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().add({{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; + } + this.{{name}}.add({{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + if (this.{{name}} == null || !this.{{name}}.isPresent()) { + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); + } + try { + this.{{name}}.get().put(key, {{name}}Item); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + {{^required}} + if (this.{{name}} == null) { + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; + } + {{/required}} + this.{{name}}.put(key, {{name}}Item); + return this; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isMap}} + + {{/isReadOnly}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#required}} +{{#isNullable}} + @{{javaxPackage}}.annotation.Nullable +{{/isNullable}} +{{^isNullable}} + @{{javaxPackage}}.annotation.Nonnull +{{/isNullable}} +{{/required}} +{{^required}} + @{{javaxPackage}}.annotation.Nullable +{{/required}} +{{#jsonb}} + @JsonbProperty("{{baseName}}") +{{/jsonb}} +{{#useBeanValidation}} +{{>beanValidation}} +{{/useBeanValidation}} +{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{/swagger1AnnotationLibrary}} +{{#swagger2AnnotationLibrary}} + @Schema({{#example}}example = "{{{.}}}", {{/example}}requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}}, description = "{{{description}}}") +{{/swagger2AnnotationLibrary}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#vendorExtensions.x-is-jackson-optional-nullable}} + {{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}} + @JsonIgnore +{{/vendorExtensions.x-is-jackson-optional-nullable}} +{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} + public {{{datatypeWithEnum}}} {{getter}}() { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + {{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}} + if ({{name}} == null) { + {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}}; + } + {{/isReadOnly}} + return {{name}}.orElse(null); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + return {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + + {{#vendorExtensions.x-is-jackson-optional-nullable}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + {{#isReadOnly}}private{{/isReadOnly}}{{^isReadOnly}}public{{/isReadOnly}} void {{setter}}_JsonNullable(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) { + {{! For getters/setters that have name differing from attribute name, we must include setter (albeit private) for jackson to be able to set the attribute}} + this.{{name}} = {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{^isReadOnly}} +{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} +{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{> jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{name}} = {{name}}; + {{/vendorExtensions.x-is-jackson-optional-nullable}} + } + {{/isReadOnly}} + + {{/vars}} +{{>libraries/resttemplate/additional_properties}} + @Override + public boolean equals(Object o) { + {{#useReflectionEqualsHashCode}} + return EqualsBuilder.reflectionEquals(this, o, false, null, true); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} && + {{/-last}}{{/vars}}{{#additionalPropertiesType}} && + Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}} + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public int hashCode() { + {{#useReflectionEqualsHashCode}} + return HashCodeBuilder.reflectionHashCode(this); + {{/useReflectionEqualsHashCode}} + {{^useReflectionEqualsHashCode}} + return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}{{#hasVars}}, {{/hasVars}}{{^hasVars}}{{#parent}}, {{/parent}}{{/hasVars}}additionalProperties{{/additionalPropertiesType}}); + {{/useReflectionEqualsHashCode}} + }{{#vendorExtensions.x-jackson-optional-nullable-helpers}} + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + }{{/vendorExtensions.x-jackson-optional-nullable-helpers}} + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}} + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + {{/parent}} + {{#vars}} + sb.append(" {{name}}: ").append({{#isPassword}}"*"{{/isPassword}}{{^isPassword}}toIndentedString({{name}}){{/isPassword}}).append("\n"); + {{/vars}} + {{#additionalPropertiesType}} + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + {{/additionalPropertiesType}} + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private{{#jsonb}} static{{/jsonb}} String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +{{#supportUrlQuery}} + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + {{#allVars}} + // add `{{baseName}}` to the URL query string + {{#isArray}} + {{#items.isPrimitiveType}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/uniqueItems}} + {{/items.isPrimitiveType}} + {{^items.isPrimitiveType}} + {{#items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + joiner.add(_item.toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + i++; + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + joiner.add({{getter}}().get(i).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{^items.isModel}} + {{#uniqueItems}} + if ({{getter}}() != null) { + int i = 0; + for ({{{items.dataType}}} _item : {{getter}}()) { + if (_item != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(_item), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + i++; + } + } + {{/uniqueItems}} + {{^uniqueItems}} + if ({{getter}}() != null) { + for (int i = 0; i < {{getter}}().size(); i++) { + if ({{getter}}().get(i) != null) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf({{getter}}().get(i)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + } + {{/uniqueItems}} + {{/items.isModel}} + {{/items.isPrimitiveType}} + {{/isArray}} + {{^isArray}} + {{#isMap}} + {{^items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + try { + joiner.add(String.format("%s{{baseName}}%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + {{getter}}().get(_key), URLEncoder.encode(String.valueOf({{getter}}().get(_key)), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + } + {{/items.isModel}} + {{#items.isModel}} + if ({{getter}}() != null) { + for (String _key : {{getter}}().keySet()) { + if ({{getter}}().get(_key) != null) { + joiner.add({{getter}}().get(_key).toUrlQueryString(String.format("%s{{baseName}}%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + } + } + } + {{/items.isModel}} + {{/isMap}} + {{^isMap}} + {{#isPrimitiveType}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isPrimitiveType}} + {{^isPrimitiveType}} + {{#isModel}} + if ({{getter}}() != null) { + joiner.add({{getter}}().toUrlQueryString(prefix + "{{{baseName}}}" + suffix)); + } + {{/isModel}} + {{^isModel}} + if ({{getter}}() != null) { + try { + joiner.add(String.format("%s{{{baseName}}}%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf({{{getter}}}()), "UTF-8").replaceAll("\\+", "%20"))); + } catch (UnsupportedEncodingException e) { + // Should never happen, UTF-8 is always supported + throw new RuntimeException(e); + } + } + {{/isModel}} + {{/isPrimitiveType}} + {{/isMap}} + {{/isArray}} + + {{/allVars}} + return joiner.toString(); + } +{{/supportUrlQuery}} +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArray}} + out.writeList(this); +{{/isArray}} +{{^isArray}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArray}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArray}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArray}} +{{^isArray}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArray}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArray}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArray}} +{{^isArray}} + return new {{classname}}(in); +{{/isArray}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} +{{#generateBuilders}} + + {{>javaBuilder}} +{{/generateBuilders}} + +} diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java index eba01300602bd..2b8777462c632 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Bird.java @@ -91,6 +91,7 @@ public void setColor(String color) { this.color = color; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index e9b38219f529b..978a383d6419e 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -91,6 +91,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java index b33e3d3020cdc..c43116392ee98 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DataQuery.java @@ -126,17 +126,6 @@ public void setDate(OffsetDateTime date) { this.date = date; } - @Override - public DataQuery id(Long id) { - this.setId(id); - return this; - } - - @Override - public DataQuery outcomes(List outcomes) { - this.setOutcomes(outcomes); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java index 1029fd39a93a4..8209caaca9345 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/DefaultValue.java @@ -398,6 +398,7 @@ public void setStringNullable(String stringNullable) { this.stringNullable = JsonNullable.of(stringNullable); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java index 739056718813b..a0037d18066fd 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/NumberPropertiesOnly.java @@ -123,6 +123,7 @@ public void setDouble(Double _double) { this._double = _double; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index 2d1b9cda8c01d..52411b16e66e0 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -265,6 +265,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java index 339bc1b76a9e5..4e1c3f61c6199 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Query.java @@ -139,6 +139,7 @@ public void setOutcomes(List outcomes) { this.outcomes = outcomes; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index 7fec324a881fc..bdd2ea9b5de31 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -91,6 +91,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java index aa08d13325039..df850c4ad8886 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestFormObjectMultipartRequestMarker.java @@ -63,6 +63,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java index b6048f6b73989..1491bc5997264 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java @@ -150,6 +150,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java index b9bc73ca806a3..b092dd3d98626 100644 --- a/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java +++ b/samples/client/echo_api/java/resttemplate/src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java @@ -74,6 +74,7 @@ public void setValues(List values) { this.values = values; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java index 0c0c4528047f0..309c6b2b682aa 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -99,6 +99,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 079c3e3de4c61..964ffea99a486 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -130,6 +130,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java index 7f30b5a338c80..521d7c9c31eaa 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -257,6 +257,7 @@ public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java index d0ffd0c62f7c0..0fae296560a1c 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -279,6 +279,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java index 9864c8ec549cf..5bf4f8d1b0800 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -99,6 +99,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java index 19662fb2b87ab..65029ce9e8e96 100644 --- a/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-jakarta/src/main/java/org/openapitools/client/model/User.java @@ -279,6 +279,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java index 29ac843a6e6b5..25f950634f8fe 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Category.java @@ -96,6 +96,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ec0665c535b2a..c692032c65335 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -127,6 +127,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java index 2e4fc3409956d..c396f07e4dd52 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Order.java @@ -254,6 +254,7 @@ public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java index 6e58e1dbf2f90..804ea4f8f270d 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Pet.java @@ -276,6 +276,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java index 6a8e3fce53b40..54e1d9eddb9be 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/Tag.java @@ -96,6 +96,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java index bbecf6d9d715f..be8b55a55cd00 100644 --- a/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-swagger1/src/main/java/org/openapitools/client/model/User.java @@ -276,6 +276,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java index 58a60d7887748..7c9aaa9b55a3c 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Category.java @@ -95,6 +95,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 6e3c6c40b7390..c2c3d83c70338 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -126,6 +126,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java index a5b1998d21b02..f6f86c1a20331 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -253,6 +253,7 @@ public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java index 8bae552528c8f..be05e97ce4346 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -275,6 +275,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java index 08974a145d3cf..2be2c87856884 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -95,6 +95,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java index 610e0c2a479b7..e42344e2f1d1d 100644 --- a/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-swagger2/src/main/java/org/openapitools/client/model/User.java @@ -275,6 +275,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 2217835f5fb9f..9d7c2712043e6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -126,6 +126,7 @@ public void setMapOfMapProperty(Map> mapOfMapPropert this.mapOfMapProperty = mapOfMapProperty; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 62e4ffc6c0522..680f097afbb75 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -105,6 +105,7 @@ public void setSingleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index b9e9099e644b5..672c07a8a483b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -117,6 +117,7 @@ public void setColor(String color) { this.color = color; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 95047de49d214..b85577110d55e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -86,6 +86,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 08cea5ca20b1f..287e8eedcdc6c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -86,6 +86,7 @@ public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java index c4929a75e9a83..61bda6adbd7c6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -170,6 +170,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java index b5e24c72e8b7f..10e23a42e247a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Capitalization.java @@ -232,6 +232,7 @@ public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java index 0b8ffd815b3da..f4f6c1685dbfa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Cat.java @@ -83,17 +83,6 @@ public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - @Override - public Cat className(String className) { - this.setClassName(className); - return this; - } - - @Override - public Cat color(String color) { - this.setColor(color); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java index 6e7417a0c9744..778242407028b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Category.java @@ -104,6 +104,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java index ddecdb9676f20..81496466f3539 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -84,17 +84,6 @@ public void setOtherProperty(String otherProperty) { this.otherProperty = otherProperty; } - @Override - public ChildWithNullable type(TypeEnum type) { - this.setType(type); - return this; - } - - @Override - public ChildWithNullable nullableProperty(String nullableProperty) { - this.setNullableProperty(nullableProperty); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java index 23774abeb04d4..b7ad2d128556b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ClassModel.java @@ -72,6 +72,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java index 8394fc86f5d2c..d874e3af5f6b1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Client.java @@ -72,6 +72,7 @@ public void setClient(String client) { this.client = client; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java index b82d23968e4bb..76fd6768279d7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -74,6 +74,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java index 2a94093f440b8..3822b4e9efd25 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Dog.java @@ -83,17 +83,6 @@ public void setBreed(String breed) { this.breed = breed; } - @Override - public Dog className(String className) { - this.setClassName(className); - return this; - } - - @Override - public Dog color(String color) { - this.setColor(color); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java index 95a0a1e4e39cc..76591295997e4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -195,6 +195,7 @@ public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java index 92d2f1eee1f38..cda93f1cad739 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/EnumTest.java @@ -474,6 +474,7 @@ public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEn this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 724083e130db0..e987923781b86 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -118,6 +118,7 @@ public void setSomeMap(Map someMap) { this.someMap = someMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 0d13267e3bea9..d12f6f8416980 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -118,6 +118,7 @@ public void setFiles(List files) { this.files = files; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java index dfe1253a2f420..4572d644a3b7c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Foo.java @@ -72,6 +72,7 @@ public void setBar(String bar) { this.bar = bar; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 749660173cf2d..bb72c43eb6122 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -74,6 +74,7 @@ public void setString(Foo string) { this.string = string; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java index fcc9ed2e67c59..8dfe369f8a7f7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/FormatTest.java @@ -569,6 +569,7 @@ public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimite this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 13b89d9d2a091..bcc7fa8eb8dee 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -81,6 +81,7 @@ public String getFoo() { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 2c42af4ba80d5..6e36f51ea6f36 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -83,6 +83,7 @@ public void setNullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java index ad8aaa9a108f5..3d44986052e9b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MapTest.java @@ -249,6 +249,7 @@ public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index b19db7b0fa96e..c3a466f345c4c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -152,6 +152,7 @@ public void setMap(Map map) { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java index 680518bfdf8d6..3b244e1c417a3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Model200Response.java @@ -105,6 +105,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 665c53fc37380..ad0fb6df3ffec 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -137,6 +137,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java index 5389f79668687..511442c76f8a3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -73,6 +73,7 @@ public void setSourceURI(String sourceURI) { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java index 91737ce49274e..00afd1b4582b6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -73,6 +73,7 @@ public void set123list(String _123list) { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java index 8277511b0bdf7..7073a1a5e64a7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -73,6 +73,7 @@ public void setReturn(Integer _return) { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java index 52887521eeb7f..a0c8452e8adce 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Name.java @@ -144,6 +144,7 @@ public Integer get123number() { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java index e541b4ceed7de..e90383f8f3c64 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,10 @@ package org.openapitools.client.model; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -60,7 +64,7 @@ @XmlRootElement(name = "NullableClass") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "NullableClass") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; @XmlElement(name = "integer_prop") private JsonNullable integerProp = JsonNullable.undefined(); @@ -111,7 +115,6 @@ public class NullableClass extends HashMap { private Map objectItemsNullable = new HashMap<>(); public NullableClass() { - } public NullableClass integerProp(Integer integerProp) { @@ -580,6 +583,50 @@ public void setObjectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public NullableClass putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -601,7 +648,7 @@ public boolean equals(Object o) { equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && - super.equals(o); + Objects.equals(this.additionalProperties, nullableClass.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -610,7 +657,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, super.hashCode()); + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -624,7 +671,6 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NullableClass {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); @@ -637,6 +683,7 @@ public String toString() { sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java index 6f1204afbf64c..bfa737f07f9d0 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -73,6 +73,7 @@ public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 06f5b1c2ad3dc..64b6f9957e9fd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -189,6 +189,7 @@ public void setBars(List bars) { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java index 21168ec94d1f8..9385d0e7bbeac 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Order.java @@ -276,6 +276,7 @@ public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java index b85caf0883288..1a38e4a8fba62 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -137,6 +137,7 @@ public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index f406fced9e988..d6daab52158ed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -73,6 +73,7 @@ public void setValue(OuterEnumInteger value) { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 7d7fa9971ffe2..373ec5b9b0cb4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -163,6 +163,7 @@ public void setNullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index de96c1578516f..2fec2d54a2fcc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -305,6 +305,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 38deb7bc35ab4..b27d233247767 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -92,6 +92,7 @@ public void setBaz(String baz) { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java index d5b8a37e1cc47..2d2ac7f5a4bda 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -73,6 +73,7 @@ public SpecialModelName() { this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java index 3c465558b890d..3e96ba224dff2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Tag.java @@ -104,6 +104,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index bec47c9420264..c7f6688782f13 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,10 @@ package org.openapitools.client.model; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,8 +24,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.dataformat.xml.annotation.*; @@ -40,13 +42,12 @@ @XmlRootElement(name = "TestInlineFreeformAdditionalPropertiesRequest") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "TestInlineFreeformAdditionalPropertiesRequest") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; @XmlElement(name = "someProperty") private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { @@ -76,6 +77,50 @@ public void setSomeProperty(String someProperty) { this.someProperty = someProperty; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -86,20 +131,20 @@ public boolean equals(Object o) { } TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && - super.equals(o); + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(someProperty, super.hashCode()); + return Objects.hash(someProperty, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java index 6acd0a8613db3..02c49b2aa27e6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/User.java @@ -296,6 +296,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index f3a4388c6a8bd..e8622066f6f4b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -117,6 +117,7 @@ public void setMapOfMapProperty(Map> mapOfMapPropert this.mapOfMapProperty = mapOfMapProperty; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 23a704abc27f4..9f450e1d73052 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -100,6 +100,7 @@ public void setSingleRefType(SingleRefType singleRefType) { this.singleRefType = singleRefType; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index e030783bd8d7e..144da03e1148f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -112,6 +112,7 @@ public void setColor(String color) { this.color = color; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index f52e4ca8a90c2..a813cab336280 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -81,6 +81,7 @@ public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 5ec0dd726867c..df7578e13205c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -81,6 +81,7 @@ public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java index 789ec1dcf1a17..ed428e9b15ba5 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -157,6 +157,7 @@ public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java index 55300c3c0497f..c4d9bdd76d138 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java @@ -219,6 +219,7 @@ public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java index 4412e64342009..7c357a8fb738d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java @@ -81,17 +81,6 @@ public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - @Override - public Cat className(String className) { - this.setClassName(className); - return this; - } - - @Override - public Cat color(String color) { - this.setColor(color); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java index 67bc4519b5d97..c080ff60e8042 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java @@ -99,6 +99,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java index 30a5fa82b3109..389ad9177d747 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -82,17 +82,6 @@ public void setOtherProperty(String otherProperty) { this.otherProperty = otherProperty; } - @Override - public ChildWithNullable type(TypeEnum type) { - this.setType(type); - return this; - } - - @Override - public ChildWithNullable nullableProperty(String nullableProperty) { - this.setNullableProperty(nullableProperty); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java index 852b3bec213d7..6f7fd82c7be7c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java @@ -69,6 +69,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java index 31bb29947325f..f1b627138ecba 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java @@ -69,6 +69,7 @@ public void setClient(String client) { this.client = client; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 048143c4e39aa..1567e490660b7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -71,6 +71,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java index 7e4cb7a57167c..16a0b3846d50d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java @@ -81,17 +81,6 @@ public void setBreed(String breed) { this.breed = breed; } - @Override - public Dog className(String className) { - this.setClassName(className); - return this; - } - - @Override - public Dog color(String color) { - this.setColor(color); - return this; - } @Override public boolean equals(Object o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java index a7de4d14f760c..eb0cc148af20f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -180,6 +180,7 @@ public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java index 836b9fc93fbb8..2927945a5d86c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java @@ -440,6 +440,7 @@ public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEn this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 274f80cec557d..cb8b83d542ee7 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -111,6 +111,7 @@ public void setSomeMap(Map someMap) { this.someMap = someMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index be1a5b21a2584..537e1309c738c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -111,6 +111,7 @@ public void setFiles(List files) { this.files = files; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java index 3db56b8118ba7..70c00f94072ce 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java @@ -69,6 +69,7 @@ public void setBar(String bar) { this.bar = bar; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 96fabe1e73268..dbf7d26d14369 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -71,6 +71,7 @@ public void setString(Foo string) { this.string = string; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java index ac3525596ceff..98cb9d51b9ae8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java @@ -535,6 +535,7 @@ public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimite this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 1ed4aa16f409a..2cfba1e96c26e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -82,6 +82,7 @@ public String getFoo() { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java index b867142bdb016..186625306f19c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -81,6 +81,7 @@ public void setNullableMessage(String nullableMessage) { this.nullableMessage = JsonNullable.of(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java index 5e47cf69f7fb2..aef50a46eb934 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java @@ -228,6 +228,7 @@ public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a0e5671508375..02ab6e94b732e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -142,6 +142,7 @@ public void setMap(Map map) { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java index 36ecf05f22583..94ed7c9387669 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java @@ -100,6 +100,7 @@ public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 3544720b02c82..dd19ed07e54a4 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -130,6 +130,7 @@ public void setMessage(String message) { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java index 4071b1c7c1c5f..48613f31cc2c0 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -70,6 +70,7 @@ public void setSourceURI(String sourceURI) { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java index cca68831913b4..4d2cd1392db8b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -70,6 +70,7 @@ public void set123list(String _123list) { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java index 65a080bb4efa9..242aee8de8c88 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -70,6 +70,7 @@ public void setReturn(Integer _return) { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java index 09a69b043ffdc..d9d75ef683542 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java @@ -149,6 +149,7 @@ public Integer get123number() { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java index 199f81bf0722e..fa8d5e9c9ef66 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,10 @@ package org.openapitools.client.model; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -53,7 +57,7 @@ NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; private JsonNullable integerProp = JsonNullable.undefined(); @@ -91,14 +95,12 @@ public class NullableClass extends HashMap { private Map objectItemsNullable; public NullableClass() { - } /** * Constructor with all args parameters */ public NullableClass(@JsonProperty(JSON_PROPERTY_INTEGER_PROP) Integer integerProp, @JsonProperty(JSON_PROPERTY_NUMBER_PROP) BigDecimal numberProp, @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) Boolean booleanProp, @JsonProperty(JSON_PROPERTY_STRING_PROP) String stringProp, @JsonProperty(JSON_PROPERTY_DATE_PROP) LocalDate dateProp, @JsonProperty(JSON_PROPERTY_DATETIME_PROP) OffsetDateTime datetimeProp, @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) List arrayNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) List arrayAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) List arrayItemsNullable, @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) Map objectNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) Map objectAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) Map objectItemsNullable) { - super(); this.integerProp = integerProp == null ? JsonNullable.undefined() : JsonNullable.of(integerProp); this.numberProp = numberProp == null ? JsonNullable.undefined() : JsonNullable.of(numberProp); this.booleanProp = booleanProp == null ? JsonNullable.undefined() : JsonNullable.of(booleanProp); @@ -557,6 +559,50 @@ public void setObjectItemsNullable(Map objectItemsNullable) { this.objectItemsNullable = objectItemsNullable; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public NullableClass putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -578,7 +624,7 @@ public boolean equals(Object o) { equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && - super.equals(o); + Objects.equals(this.additionalProperties, nullableClass.additionalProperties); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -587,7 +633,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, super.hashCode()); + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); } private static int hashCodeNullable(JsonNullable a) { @@ -601,7 +647,6 @@ private static int hashCodeNullable(JsonNullable a) { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class NullableClass {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); @@ -614,6 +659,7 @@ public String toString() { sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java index c3cb81063fcc0..89aa6a355d0fc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -70,6 +70,7 @@ public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 6b6413bdb7eb4..436525bac7c57 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -178,6 +178,7 @@ public void setBars(List bars) { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java index e6f4cc9017ca0..876126105a2c3 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java @@ -257,6 +257,7 @@ public void setComplete(Boolean complete) { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java index 33bbbc1288d44..b79a4764af816 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -130,6 +130,7 @@ public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index ab1362f31e987..3716447298fc8 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -70,6 +70,7 @@ public void setValue(OuterEnumInteger value) { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java index deb1c378819fa..99bbfb56d9c0c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -156,6 +156,7 @@ public void setNullableProperty(String nullableProperty) { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index a136dae000fc6..e68f7d7fda333 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -281,6 +281,7 @@ public void setStatus(StatusEnum status) { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b8d5b12b81569..ae1f2a675f58d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -98,6 +98,7 @@ public void setBaz(String baz) { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java index ba9e4803ad1f8..a86a8da0bae17 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -70,6 +70,7 @@ public SpecialModelName(@JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) Lon this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java index c145badeda8d9..0f3270d23fdc2 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java @@ -99,6 +99,7 @@ public void setName(String name) { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index cc9517876dd80..30de7a224c134 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,10 @@ package org.openapitools.client.model; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,8 +24,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -33,19 +35,17 @@ }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.9.0-SNAPSHOT") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } /** * Constructor with all args parameters */ public TestInlineFreeformAdditionalPropertiesRequest(@JsonProperty(JSON_PROPERTY_SOME_PROPERTY) String someProperty) { - super(); this.someProperty = someProperty; } @@ -74,6 +74,50 @@ public void setSomeProperty(String someProperty) { this.someProperty = someProperty; } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + @Override public boolean equals(Object o) { if (this == o) { @@ -84,20 +128,20 @@ public boolean equals(Object o) { } TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && - super.equals(o); + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(someProperty, super.hashCode()); + return Objects.hash(someProperty, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java index 79fa96a4b92ef..3c43002d511e9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/User.java @@ -279,6 +279,7 @@ public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } + @Override public boolean equals(Object o) { if (this == o) {