diff --git a/bin/utils/test_file_list.yaml b/bin/utils/test_file_list.yaml index 48becd05e82..dfbea50f24e 100644 --- a/bin/utils/test_file_list.yaml +++ b/bin/utils/test_file_list.yaml @@ -51,6 +51,8 @@ sha256: 67a9e63e13ebddac21cb236aa015edce30f5d3bd8d6adcf50044cad00d48c45e - filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java" sha256: 15eeb6d8a9a79d0f1930b861540d9c5780d6c49ea4fdb68269ac3e7ec481e142 +- filename: "samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/JacksonTest.java" + sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3 # rust axum test files - filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs" sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600 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 6a6fcec080d..43929c20296 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 @@ -593,6 +593,14 @@ public class JavaClientCodegen extends AbstractJavaCodegen } else if (WEBCLIENT.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); + + // 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 (RESTCLIENT.equals(getLibrary())) { forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); applyJakartaPackage(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/additional_properties.mustache new file mode 100644 index 00000000000..8e718279245 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/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/webclient/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/model.mustache new file mode 100644 index 00000000000..108748f607e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/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/webclient/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pojo.mustache new file mode 100644 index 00000000000..2b9423b773f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pojo.mustache @@ -0,0 +1,620 @@ +/** + * {{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}} + {{>nullable_var_annotations}} + {{#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}}({{>nullable_var_annotations}} {{{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}} + {{>nullable_var_annotations}} +{{#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}}({{>nullable_var_annotations}} {{{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/webclient/additional_properties}} + {{#parent}} + {{#readWriteVars}} + {{#isOverridden}} + @Override + public {{classname}} {{name}}({{>nullable_var_annotations}} {{{datatypeWithEnum}}} {{name}}) { + {{#vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + {{^vendorExtensions.x-is-jackson-optional-nullable}} + this.{{setter}}({{name}}); + {{/vendorExtensions.x-is-jackson-optional-nullable}} + return this; + } + + {{/isOverridden}} + {{/readWriteVars}} + {{/parent}} + @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}}, 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.datatypeWithEnum}}} _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/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 26b4d790425..996484c0d62 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -111,6 +111,7 @@ public class AdditionalPropertiesClass { this.mapOfMapProperty = mapOfMapProperty; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 3a10e6dd225..93152f450d4 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -94,6 +94,7 @@ public class AllOfWithSingleRef { this.singleRefType = singleRefType; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java index 7efc55b256a..5a11bc5684d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Animal.java @@ -106,6 +106,7 @@ public class Animal { this.color = color; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9dc5702fb6f..6b0ecfa8d15 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -75,6 +75,7 @@ public class ArrayOfArrayOfNumberOnly { this.arrayArrayNumber = arrayArrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index f651e2b6740..fc0fa224941 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -75,6 +75,7 @@ public class ArrayOfNumberOnly { this.arrayNumber = arrayNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java index 5403435bb34..978a201914a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -151,6 +151,7 @@ public class ArrayTest { this.arrayArrayOfModel = arrayArrayOfModel; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java index 6f62a0d6713..c12db045bc6 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Capitalization.java @@ -213,6 +213,7 @@ public class Capitalization { this.ATT_NAME = ATT_NAME; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java index f7f133647ca..cfc964c3807 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Cat.java @@ -74,6 +74,7 @@ public class Cat extends Animal { this.declawed = declawed; } + @Override public Cat className(@jakarta.annotation.Nonnull String className) { this.setClassName(className); diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java index 7db26795c45..3232274cb62 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Category.java @@ -93,6 +93,7 @@ public class Category { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java index b8640a1f684..c616be02326 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -75,6 +75,7 @@ public class ChildWithNullable extends ParentWithNullable { this.otherProperty = otherProperty; } + @Override public ChildWithNullable type(@jakarta.annotation.Nullable TypeEnum type) { this.setType(type); diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java index 3ae7b2fa13f..cc8d3f8a2de 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ClassModel.java @@ -63,6 +63,7 @@ public class ClassModel { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java index d687ec76b1d..2f5da90266b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Client.java @@ -63,6 +63,7 @@ public class Client { this.client = client; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java index b343e1bb2ed..72223c6e565 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -65,6 +65,7 @@ public class DeprecatedObject { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java index 791c2015578..45fcd54b234 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Dog.java @@ -74,6 +74,7 @@ public class Dog extends Animal { this.breed = breed; } + @Override public Dog className(@jakarta.annotation.Nonnull String className) { this.setClassName(className); diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java index ae9914297c6..2dd09def0a4 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -174,6 +174,7 @@ public class EnumArrays { this.arrayEnum = arrayEnum; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java index 38ad755a988..fdc569d7d9b 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/EnumTest.java @@ -434,6 +434,7 @@ public class EnumTest { this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index bff220b9951..a5a8c1cf3ec 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -105,6 +105,7 @@ public class FakeBigDecimalMap200Response { this.someMap = someMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 9ff286896de..b59fb46b48c 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -105,6 +105,7 @@ public class FileSchemaTestClass { this.files = files; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java index 8e6cc1240cf..75b203b7a69 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Foo.java @@ -63,6 +63,7 @@ public class Foo { this.bar = bar; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 7fe6b918ff1..fbaf3c02496 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -65,6 +65,7 @@ public class FooGetDefaultResponse { this.string = string; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java index f0a0cce1fcb..b4c1200ec8f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/FormatTest.java @@ -529,6 +529,7 @@ public class FormatTest { this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 7e33df01d83..e32c8b85501 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -84,6 +84,7 @@ public class HasOnlyReadOnly { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 84a0162b20a..9314dbe349a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -75,6 +75,7 @@ public class HealthCheckResult { this.nullableMessage = JsonNullable.of(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java index beaf0143922..ea93445dd67 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MapTest.java @@ -222,6 +222,7 @@ public class MapTest { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 30d13e8301e..629d898757a 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -136,6 +136,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java index aa7a5624ea6..5b5f6d47d6f 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Model200Response.java @@ -94,6 +94,7 @@ public class Model200Response { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 421eeea1d46..e11ce482107 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -124,6 +124,7 @@ public class ModelApiResponse { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java index 65566d3f003..5aa105e34e0 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelFile.java @@ -64,6 +64,7 @@ public class ModelFile { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java index 942df349bc5..65875a0c0df 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelList.java @@ -64,6 +64,7 @@ public class ModelList { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java index 7a609131dbc..5f0714ea5f2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -64,6 +64,7 @@ public class ModelReturn { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java index 2818d666827..881e45f409e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Name.java @@ -143,6 +143,7 @@ public class Name { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java index 728028c6b0b..c753fe910fb 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-jakarta/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 @@ import com.fasterxml.jackson.annotation.JsonTypeName; NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; @jakarta.annotation.Nullable private JsonNullable integerProp = JsonNullable.undefined(); @@ -103,7 +107,6 @@ public class NullableClass extends HashMap { private Map objectItemsNullable = new HashMap<>(); public NullableClass() { - } public NullableClass integerProp(@jakarta.annotation.Nullable Integer integerProp) { @@ -550,6 +553,50 @@ public class NullableClass extends HashMap { 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) { @@ -571,7 +618,7 @@ public class NullableClass extends HashMap { 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) { @@ -580,7 +627,7 @@ public class NullableClass extends HashMap { @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) { @@ -594,7 +641,6 @@ public class NullableClass extends HashMap { 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"); @@ -607,6 +653,7 @@ public class NullableClass extends HashMap { 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/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java index a99076c02c9..c5d56c6c7f2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,6 +64,7 @@ public class NumberOnly { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index a406352525c..c16a42d71bd 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -172,6 +172,7 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java index 264441acdbc..872c2bceb0e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Order.java @@ -251,6 +251,7 @@ public class Order { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java index a01bda251c9..e1d4fca7e7e 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -124,6 +124,7 @@ public class OuterComposite { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index e53aa0ef943..0e8d87b6edf 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -64,6 +64,7 @@ public class OuterObjectWithEnumProperty { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 7a31dc82ae7..62310ee7833 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -150,6 +150,7 @@ public class ParentWithNullable { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java index bda2705667d..685b63e88f2 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Pet.java @@ -275,6 +275,7 @@ public class Pet { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 94c18de2db4..114b875f0fe 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -92,6 +92,7 @@ public class ReadOnlyFirst { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java index aecf06ac0ec..1fbb1f88635 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -64,6 +64,7 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java index e025a7a1a2d..cbe5678a26d 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/Tag.java @@ -93,6 +93,7 @@ public class Tag { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 9523a039bb5..d7bf71085f7 100644 --- a/samples/client/petstore/java/webclient-jakarta/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient-jakarta/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.JsonProperty; 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,13 +35,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; @jakarta.annotation.Nullable private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } public TestInlineFreeformAdditionalPropertiesRequest someProperty(@jakarta.annotation.Nullable String someProperty) { @@ -67,6 +68,50 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap 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) { @@ -77,20 +122,20 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapof(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java index 16350b30edd..ecbbc12cb28 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MapTest.java @@ -227,6 +227,7 @@ public class MapTest { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index cce2b1f87ad..4597ed4eda2 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -140,6 +140,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java index 32bd5c59e3f..dd35ae04509 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Model200Response.java @@ -98,6 +98,7 @@ public class Model200Response { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 2dfa1fccf4c..208cfa49882 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -128,6 +128,7 @@ public class ModelApiResponse { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java index b92b5ba5dfd..23b83c748e9 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -67,6 +67,7 @@ public class ModelFile { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java index b4a511f5f6e..cb53de1d3d4 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelList.java @@ -66,6 +66,7 @@ public class ModelList { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java index 91a6c0344b2..a5cb7a6ef1f 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -67,6 +67,7 @@ public class ModelReturn { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java index f1500269ad8..579f807a10a 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Name.java @@ -149,6 +149,7 @@ public class Name { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java index 62647b34c86..f45ec5fcbb8 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-swagger2/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; @@ -54,7 +58,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; @javax.annotation.Nullable private JsonNullable integerProp = JsonNullable.undefined(); @@ -104,7 +108,6 @@ public class NullableClass extends HashMap { private Map objectItemsNullable; public NullableClass() { - } public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) { @@ -563,6 +566,50 @@ public class NullableClass extends HashMap { 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) { @@ -584,7 +631,7 @@ public class NullableClass extends HashMap { 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) { @@ -593,7 +640,7 @@ public class NullableClass extends HashMap { @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) { @@ -607,7 +654,6 @@ public class NullableClass extends HashMap { 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"); @@ -620,6 +666,7 @@ public class NullableClass extends HashMap { 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/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java index d3df99f5d61..e0d5db279c2 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -66,6 +66,7 @@ public class NumberOnly { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 5c6cba61928..14b2aa2a7fa 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -177,6 +177,7 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java index 7f0f864061d..10f98752a33 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Order.java @@ -258,6 +258,7 @@ public class Order { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java index 8ab8a3ce413..4bd579201df 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -128,6 +128,7 @@ public class OuterComposite { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 1dbfe0d2d24..5a98b9c72e1 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -66,6 +66,7 @@ public class OuterObjectWithEnumProperty { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java index 8a24656e623..222073febac 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -153,6 +153,7 @@ public class ParentWithNullable { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java index 03f60daaf52..65e6bbe96f0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Pet.java @@ -282,6 +282,7 @@ public class Pet { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1a64011cc4d..c9a066d4aa9 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -95,6 +95,7 @@ public class ReadOnlyFirst { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java index ae469fc0308..5ea5fb30428 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -66,6 +66,7 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java index 0df25de1049..a51ef37572b 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/Tag.java @@ -96,6 +96,7 @@ public class Tag { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 87b73859659..5c351bc16e0 100644 --- a/samples/client/petstore/java/webclient-swagger2/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient-swagger2/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; @@ -21,8 +25,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.v3.oas.annotations.media.Schema; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -34,13 +36,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; @javax.annotation.Nullable private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) { @@ -69,6 +70,50 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap 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) { @@ -79,20 +124,20 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapof(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MapTest.java index 5a8c2595ebe..c84e6f0d1ca 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MapTest.java @@ -222,6 +222,7 @@ public class MapTest { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b04e0be0b4..2b7d0ee5926 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -136,6 +136,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Model200Response.java index 16cef475a06..4eb44d47529 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Model200Response.java @@ -94,6 +94,7 @@ public class Model200Response { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ca4ca6f9567..9c46e764343 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -124,6 +124,7 @@ public class ModelApiResponse { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelFile.java index 0229fb0205f..af9bc6e8c29 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelFile.java @@ -64,6 +64,7 @@ public class ModelFile { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelList.java index 83d2405d8e6..997cf2330c1 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelList.java @@ -64,6 +64,7 @@ public class ModelList { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelReturn.java index 4de0a114545..2839503fadd 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -64,6 +64,7 @@ public class ModelReturn { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Name.java index f6b27f43d56..a5e18ca84c9 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Name.java @@ -143,6 +143,7 @@ public class Name { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NullableClass.java index 6470650b8aa..5ae970e9c2b 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/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 @@ import com.fasterxml.jackson.annotation.JsonTypeName; NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; @javax.annotation.Nullable private JsonNullable integerProp = JsonNullable.undefined(); @@ -103,7 +107,6 @@ public class NullableClass extends HashMap { private Map objectItemsNullable = new HashMap<>(); public NullableClass() { - } public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) { @@ -550,6 +553,50 @@ public class NullableClass extends HashMap { 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) { @@ -571,7 +618,7 @@ public class NullableClass extends HashMap { 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) { @@ -580,7 +627,7 @@ public class NullableClass extends HashMap { @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) { @@ -594,7 +641,6 @@ public class NullableClass extends HashMap { 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"); @@ -607,6 +653,7 @@ public class NullableClass extends HashMap { 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/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NumberOnly.java index 010fe355b6e..ba9687af8f6 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,6 +64,7 @@ public class NumberOnly { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 7d7852ecc88..f600e495994 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -172,6 +172,7 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java index b8ffbc098db..87dfee32ff4 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Order.java @@ -251,6 +251,7 @@ public class Order { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterComposite.java index 1ab43415946..0ffaeb97008 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -124,6 +124,7 @@ public class OuterComposite { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 65e7be51c7e..f94519d3642 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -64,6 +64,7 @@ public class OuterObjectWithEnumProperty { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ParentWithNullable.java index b7e44bafa5d..75d0d9dd732 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -150,6 +150,7 @@ public class ParentWithNullable { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java index 94af34d784f..4da0451b84e 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Pet.java @@ -275,6 +275,7 @@ public class Pet { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7cc5a0aa029..1fa6a597ac2 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -92,6 +92,7 @@ public class ReadOnlyFirst { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/SpecialModelName.java index 47fe712fbf5..756cf7478b2 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -64,6 +64,7 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java index 68e94829bd4..29af0f7d529 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/Tag.java @@ -93,6 +93,7 @@ public class Tag { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 4b9aedd98a1..b18432c0806 100644 --- a/samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient-useSingleRequestParameter/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.JsonProperty; 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,13 +35,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; @javax.annotation.Nullable private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) { @@ -67,6 +68,50 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap 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) { @@ -77,20 +122,20 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapof(nullableMessage); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java index 2362bf96027..1ae38affed3 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MapTest.java @@ -222,6 +222,7 @@ public class MapTest { this.indirectMap = indirectMap; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index c57e2c0b343..d3d80717179 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -136,6 +136,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { this.map = map; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java index 16cef475a06..4eb44d47529 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Model200Response.java @@ -94,6 +94,7 @@ public class Model200Response { this.propertyClass = propertyClass; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java index ca4ca6f9567..9c46e764343 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -124,6 +124,7 @@ public class ModelApiResponse { this.message = message; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java index 0229fb0205f..af9bc6e8c29 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -64,6 +64,7 @@ public class ModelFile { this.sourceURI = sourceURI; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java index 83d2405d8e6..997cf2330c1 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -64,6 +64,7 @@ public class ModelList { this._123list = _123list; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java index 4de0a114545..2839503fadd 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -64,6 +64,7 @@ public class ModelReturn { this._return = _return; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java index f6b27f43d56..a5e18ca84c9 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Name.java @@ -143,6 +143,7 @@ public class Name { + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java index c4fd8b0cb38..3ae2bfbf1ed 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/webclient/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 @@ import com.fasterxml.jackson.annotation.JsonTypeName; NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class NullableClass extends HashMap { +public class NullableClass { public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; @javax.annotation.Nullable private JsonNullable integerProp = JsonNullable.undefined(); @@ -103,7 +107,6 @@ public class NullableClass extends HashMap { private Map objectItemsNullable; public NullableClass() { - } public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) { @@ -550,6 +553,50 @@ public class NullableClass extends HashMap { 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) { @@ -571,7 +618,7 @@ public class NullableClass extends HashMap { 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) { @@ -580,7 +627,7 @@ public class NullableClass extends HashMap { @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) { @@ -594,7 +641,6 @@ public class NullableClass extends HashMap { 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"); @@ -607,6 +653,7 @@ public class NullableClass extends HashMap { 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/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java index 010fe355b6e..ba9687af8f6 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -64,6 +64,7 @@ public class NumberOnly { this.justNumber = justNumber; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index e95d5a848bb..fdd1917657f 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -172,6 +172,7 @@ public class ObjectWithDeprecatedFields { this.bars = bars; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java index b8ffbc098db..87dfee32ff4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Order.java @@ -251,6 +251,7 @@ public class Order { this.complete = complete; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java index 1ab43415946..0ffaeb97008 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -124,6 +124,7 @@ public class OuterComposite { this.myBoolean = myBoolean; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index 65e7be51c7e..f94519d3642 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -64,6 +64,7 @@ public class OuterObjectWithEnumProperty { this.value = value; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java index b7e44bafa5d..75d0d9dd732 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ParentWithNullable.java @@ -150,6 +150,7 @@ public class ParentWithNullable { this.nullableProperty = JsonNullable.of(nullableProperty); } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 6fc0f09f45d..19e2df0f246 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -275,6 +275,7 @@ public class Pet { this.status = status; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 7cc5a0aa029..1fa6a597ac2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -92,6 +92,7 @@ public class ReadOnlyFirst { this.baz = baz; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java index 47fe712fbf5..756cf7478b2 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -64,6 +64,7 @@ public class SpecialModelName { this.$specialPropertyName = $specialPropertyName; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java index 68e94829bd4..29af0f7d529 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Tag.java @@ -93,6 +93,7 @@ public class Tag { this.name = name; } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 4b9aedd98a1..b18432c0806 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/webclient/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.JsonProperty; 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,13 +35,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; }) @JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.12.0-SNAPSHOT") -public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { +public class TestInlineFreeformAdditionalPropertiesRequest { public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty"; @javax.annotation.Nullable private String someProperty; public TestInlineFreeformAdditionalPropertiesRequest() { - } public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) { @@ -67,6 +68,50 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap 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) { @@ -77,20 +122,20 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap