[java][resttemplate] Fix model combining properties and additional properties (#19706)

This commit is contained in:
João Brilhante
2025-02-14 17:13:13 +01:00
committed by GitHub
parent dd67423c8c
commit a5c9c6d531
123 changed files with 1138 additions and 26 deletions

View File

@@ -101,6 +101,7 @@ public class Category {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -133,6 +133,7 @@ public class ModelApiResponse {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -263,6 +263,7 @@ public class Order {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -285,6 +285,7 @@ public class Pet {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -101,6 +101,7 @@ public class Tag {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -287,6 +287,7 @@ public class User {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -98,6 +98,7 @@ public class Category {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -130,6 +130,7 @@ public class ModelApiResponse {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -260,6 +260,7 @@ public class Order {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -282,6 +282,7 @@ public class Pet {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -98,6 +98,7 @@ public class Tag {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -284,6 +284,7 @@ public class User {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -97,6 +97,7 @@ public class Category {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -129,6 +129,7 @@ public class ModelApiResponse {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -259,6 +259,7 @@ public class Order {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -281,6 +281,7 @@ public class Pet {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -97,6 +97,7 @@ public class Tag {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -283,6 +283,7 @@ public class User {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -128,6 +128,7 @@ public class AdditionalPropertiesClass {
this.mapOfMapProperty = mapOfMapProperty;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -107,6 +107,7 @@ public class AllOfWithSingleRef {
this.singleRefType = singleRefType;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -119,6 +119,7 @@ public class Animal {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -87,6 +87,7 @@ public class ArrayOfArrayOfNumberOnly {
this.arrayArrayNumber = arrayArrayNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -87,6 +87,7 @@ public class ArrayOfNumberOnly {
this.arrayNumber = arrayNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -173,6 +173,7 @@ public class ArrayTest {
this.arrayArrayOfModel = arrayArrayOfModel;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -238,6 +238,7 @@ public class Capitalization {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -84,6 +84,7 @@ public class Cat extends Animal {
this.declawed = declawed;
}
@Override
public Cat className(@javax.annotation.Nonnull String className) {
this.setClassName(className);

View File

@@ -106,6 +106,7 @@ public class Category {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -85,6 +85,7 @@ public class ChildWithNullable extends ParentWithNullable {
this.otherProperty = otherProperty;
}
@Override
public ChildWithNullable type(@javax.annotation.Nullable TypeEnum type) {
this.setType(type);

View File

@@ -73,6 +73,7 @@ public class ClassModel {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -73,6 +73,7 @@ public class Client {
this.client = client;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -75,6 +75,7 @@ public class DeprecatedObject {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -84,6 +84,7 @@ public class Dog extends Animal {
this.breed = breed;
}
@Override
public Dog className(@javax.annotation.Nonnull String className) {
this.setClassName(className);

View File

@@ -197,6 +197,7 @@ public class EnumArrays {
this.arrayEnum = arrayEnum;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -482,6 +482,7 @@ public class EnumTest {
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -120,6 +120,7 @@ public class FakeBigDecimalMap200Response {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -120,6 +120,7 @@ public class FileSchemaTestClass {
this.files = files;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -73,6 +73,7 @@ public class Foo {
this.bar = bar;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -75,6 +75,7 @@ public class FooGetDefaultResponse {
this.string = string;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -585,6 +585,7 @@ public class FormatTest {
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -83,6 +83,7 @@ public class HasOnlyReadOnly {
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -84,6 +84,7 @@ public class HealthCheckResult {
this.nullableMessage = JsonNullable.<String>of(nullableMessage);
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -253,6 +253,7 @@ public class MapTest {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -155,6 +155,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.map = map;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -107,6 +107,7 @@ public class Model200Response {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -140,6 +140,7 @@ public class ModelApiResponse {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -74,6 +74,7 @@ public class ModelFile {
this.sourceURI = sourceURI;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -74,6 +74,7 @@ public class ModelList {
this._123list = _123list;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -74,6 +74,7 @@ public class ModelReturn {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -148,6 +148,7 @@ public class Name {
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -13,6 +13,10 @@
package org.openapitools.client.model;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
@@ -60,7 +64,7 @@ import io.github.threetenjaxb.core.*;
@XmlRootElement(name = "NullableClass")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "NullableClass")
public class NullableClass extends HashMap<String, Object> {
public class NullableClass {
public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop";
@XmlElement(name = "integer_prop")
@javax.annotation.Nullable
@@ -123,7 +127,6 @@ public class NullableClass extends HashMap<String, Object> {
private Map<String, Object> objectItemsNullable = new HashMap<>();
public NullableClass() {
}
public NullableClass integerProp(@javax.annotation.Nullable Integer integerProp) {
@@ -592,6 +595,50 @@ public class NullableClass extends HashMap<String, Object> {
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<String, Object> 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<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) properties.
* @return the additional (undeclared) properties
*/
@JsonAnyGetter
public Map<String, Object> 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) {
@@ -613,7 +660,7 @@ public class NullableClass extends HashMap<String, Object> {
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 <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
@@ -622,7 +669,7 @@ public class NullableClass extends HashMap<String, Object> {
@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 <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -636,7 +683,6 @@ public class NullableClass extends HashMap<String, Object> {
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");
@@ -649,6 +695,7 @@ public class NullableClass extends HashMap<String, Object> {
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();
}

View File

@@ -74,6 +74,7 @@ public class NumberOnly {
this.justNumber = justNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -193,6 +193,7 @@ public class ObjectWithDeprecatedFields {
this.bars = bars;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -282,6 +282,7 @@ public class Order {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -140,6 +140,7 @@ public class OuterComposite {
this.myBoolean = myBoolean;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -74,6 +74,7 @@ public class OuterObjectWithEnumProperty {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -165,6 +165,7 @@ public class ParentWithNullable {
this.nullableProperty = JsonNullable.<String>of(nullableProperty);
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -311,6 +311,7 @@ public class Pet {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -94,6 +94,7 @@ public class ReadOnlyFirst {
this.baz = baz;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -74,6 +74,7 @@ public class SpecialModelName {
this.$specialPropertyName = $specialPropertyName;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -106,6 +106,7 @@ public class Tag {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -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;
import com.fasterxml.jackson.dataformat.xml.annotation.*;
@@ -40,14 +42,13 @@ import io.github.threetenjaxb.core.*;
@XmlRootElement(name = "TestInlineFreeformAdditionalPropertiesRequest")
@XmlAccessorType(XmlAccessType.FIELD)
@JacksonXmlRootElement(localName = "TestInlineFreeformAdditionalPropertiesRequest")
public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap<String, Object> {
public class TestInlineFreeformAdditionalPropertiesRequest {
public static final String JSON_PROPERTY_SOME_PROPERTY = "someProperty";
@XmlElement(name = "someProperty")
@javax.annotation.Nullable
private String someProperty;
public TestInlineFreeformAdditionalPropertiesRequest() {
}
public TestInlineFreeformAdditionalPropertiesRequest someProperty(@javax.annotation.Nullable String someProperty) {
@@ -77,6 +78,50 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap<Strin
this.someProperty = someProperty;
}
/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
private Map<String, Object> 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<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) properties.
* @return the additional (undeclared) properties
*/
@JsonAnyGetter
public Map<String, Object> 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) {
@@ -87,20 +132,20 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap<Strin
}
TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o;
return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) &&
super.equals(o);
Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(someProperty, super.hashCode());
return Objects.hash(someProperty, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append("}");
return sb.toString();
}

View File

@@ -304,6 +304,7 @@ public class User {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -119,6 +119,7 @@ public class AdditionalPropertiesClass {
this.mapOfMapProperty = mapOfMapProperty;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -102,6 +102,7 @@ public class AllOfWithSingleRef {
this.singleRefType = singleRefType;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -114,6 +114,7 @@ public class Animal {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -82,6 +82,7 @@ public class ArrayOfArrayOfNumberOnly {
this.arrayArrayNumber = arrayArrayNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -82,6 +82,7 @@ public class ArrayOfNumberOnly {
this.arrayNumber = arrayNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -160,6 +160,7 @@ public class ArrayTest {
this.arrayArrayOfModel = arrayArrayOfModel;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -225,6 +225,7 @@ public class Capitalization {
this.ATT_NAME = ATT_NAME;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -82,6 +82,7 @@ public class Cat extends Animal {
this.declawed = declawed;
}
@Override
public Cat className(@javax.annotation.Nonnull String className) {
this.setClassName(className);

View File

@@ -101,6 +101,7 @@ public class Category {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -83,6 +83,7 @@ public class ChildWithNullable extends ParentWithNullable {
this.otherProperty = otherProperty;
}
@Override
public ChildWithNullable type(@javax.annotation.Nullable TypeEnum type) {
this.setType(type);

View File

@@ -70,6 +70,7 @@ public class ClassModel {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -70,6 +70,7 @@ public class Client {
this.client = client;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -72,6 +72,7 @@ public class DeprecatedObject {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -82,6 +82,7 @@ public class Dog extends Animal {
this.breed = breed;
}
@Override
public Dog className(@javax.annotation.Nonnull String className) {
this.setClassName(className);

View File

@@ -182,6 +182,7 @@ public class EnumArrays {
this.arrayEnum = arrayEnum;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -448,6 +448,7 @@ public class EnumTest {
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -113,6 +113,7 @@ public class FakeBigDecimalMap200Response {
this.someMap = someMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -113,6 +113,7 @@ public class FileSchemaTestClass {
this.files = files;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -70,6 +70,7 @@ public class Foo {
this.bar = bar;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -72,6 +72,7 @@ public class FooGetDefaultResponse {
this.string = string;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -551,6 +551,7 @@ public class FormatTest {
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -84,6 +84,7 @@ public class HasOnlyReadOnly {
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -82,6 +82,7 @@ public class HealthCheckResult {
this.nullableMessage = JsonNullable.<String>of(nullableMessage);
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -232,6 +232,7 @@ public class MapTest {
this.indirectMap = indirectMap;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -145,6 +145,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.map = map;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -102,6 +102,7 @@ public class Model200Response {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -133,6 +133,7 @@ public class ModelApiResponse {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -71,6 +71,7 @@ public class ModelFile {
this.sourceURI = sourceURI;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -71,6 +71,7 @@ public class ModelList {
this._123list = _123list;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -71,6 +71,7 @@ public class ModelReturn {
this._return = _return;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -153,6 +153,7 @@ public class Name {
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -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<String, Object> {
public class NullableClass {
public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop";
@javax.annotation.Nullable
private JsonNullable<Integer> integerProp = JsonNullable.<Integer>undefined();
@@ -103,14 +107,12 @@ public class NullableClass extends HashMap<String, Object> {
private Map<String, Object> objectItemsNullable;
public NullableClass() {
}
/**
* Constructor with all args parameters
*/
public NullableClass(@JsonProperty(JSON_PROPERTY_INTEGER_PROP) Integer integerProp, @JsonProperty(JSON_PROPERTY_NUMBER_PROP) BigDecimal numberProp, @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) Boolean booleanProp, @JsonProperty(JSON_PROPERTY_STRING_PROP) String stringProp, @JsonProperty(JSON_PROPERTY_DATE_PROP) LocalDate dateProp, @JsonProperty(JSON_PROPERTY_DATETIME_PROP) OffsetDateTime datetimeProp, @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) List<Object> arrayNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) List<Object> arrayAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) List<Object> arrayItemsNullable, @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) Map<String, Object> objectNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) Map<String, Object> objectAndItemsNullableProp, @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) Map<String, Object> objectItemsNullable) {
super();
this.integerProp = integerProp == null ? JsonNullable.<Integer>undefined() : JsonNullable.of(integerProp);
this.numberProp = numberProp == null ? JsonNullable.<BigDecimal>undefined() : JsonNullable.of(numberProp);
this.booleanProp = booleanProp == null ? JsonNullable.<Boolean>undefined() : JsonNullable.of(booleanProp);
@@ -569,6 +571,50 @@ public class NullableClass extends HashMap<String, Object> {
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<String, Object> 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<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}
/**
* Return the additional (undeclared) properties.
* @return the additional (undeclared) properties
*/
@JsonAnyGetter
public Map<String, Object> 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) {
@@ -590,7 +636,7 @@ public class NullableClass extends HashMap<String, Object> {
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 <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
@@ -599,7 +645,7 @@ public class NullableClass extends HashMap<String, Object> {
@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 <T> int hashCodeNullable(JsonNullable<T> a) {
@@ -613,7 +659,6 @@ public class NullableClass extends HashMap<String, Object> {
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");
@@ -626,6 +671,7 @@ public class NullableClass extends HashMap<String, Object> {
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();
}

View File

@@ -71,6 +71,7 @@ public class NumberOnly {
this.justNumber = justNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -182,6 +182,7 @@ public class ObjectWithDeprecatedFields {
this.bars = bars;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -263,6 +263,7 @@ public class Order {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -133,6 +133,7 @@ public class OuterComposite {
this.myBoolean = myBoolean;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -71,6 +71,7 @@ public class OuterObjectWithEnumProperty {
this.value = value;
}
@Override
public boolean equals(Object o) {
if (this == o) {

View File

@@ -158,6 +158,7 @@ public class ParentWithNullable {
this.nullableProperty = JsonNullable.<String>of(nullableProperty);
}
@Override
public boolean equals(Object o) {
if (this == o) {

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