diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/additional_properties.mustache index 538635ca04dd..0103b63b99ee 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/additional_properties.mustache @@ -4,7 +4,7 @@ * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ - private Map additionalProperties; + private {{#useJspecify}}@Nullable {{/useJspecify}}Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. @@ -27,7 +27,7 @@ * @return the additional (undeclared) properties */ @com.fasterxml.jackson.annotation.JsonAnyGetter - public Map getAdditionalProperties() { + public {{#useJspecify}}@Nullable {{/useJspecify}}Map getAdditionalProperties() { return additionalProperties; } @@ -36,7 +36,7 @@ * @param key the name of the property * @return the additional (undeclared) property with the specified name */ - public {{{.}}} getAdditionalProperty(String key) { + public {{#useJspecify}}{{#lambda.jSpecifyNullable}}@{{javaxPackage}}.annotation.Nullable {{/lambda.jSpecifyNullable}}{{/useJspecify}}{{#lambda.jSpecifyDatatype}}{{{.}}}{{/lambda.jSpecifyDatatype}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojoOverrides.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojoOverrides.mustache index 16aed160795b..0d8d84d37609 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojoOverrides.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojoOverrides.mustache @@ -1,5 +1,5 @@ @Override - public boolean equals(Object o) { + public boolean equals({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { {{#useReflectionEqualsHashCode}} return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} @@ -62,6 +62,6 @@ * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/additional_properties.mustache index 8e7182792457..e0722a18f356 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/additional_properties.mustache @@ -4,7 +4,7 @@ * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ - private Map additionalProperties; + private {{#useJspecify}}@Nullable {{/useJspecify}}Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. @@ -27,7 +27,7 @@ * @return the additional (undeclared) properties */ @JsonAnyGetter - public Map getAdditionalProperties() { + public {{#useJspecify}}@Nullable {{/useJspecify}}Map getAdditionalProperties() { return additionalProperties; } @@ -36,7 +36,7 @@ * @param key the name of the property * @return the additional (undeclared) property with the specified name */ - public {{{.}}} getAdditionalProperty(String key) { + public {{#useJspecify}}{{#lambda.jSpecifyNullable}}@{{javaxPackage}}.annotation.Nullable {{/lambda.jSpecifyNullable}}{{/useJspecify}}{{#lambda.jSpecifyDatatype}}{{{.}}}{{/lambda.jSpecifyDatatype}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index 9efc986c5c65..bf080453237e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -279,7 +279,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens * Return true if this {{name}} object is equal to o. */ @Override - public boolean equals(Object o) { + public boolean equals({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { {{#useReflectionEqualsHashCode}} return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} @@ -341,7 +341,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } {{#supportUrlQuery}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/additional_properties.mustache index 8e7182792457..e0722a18f356 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/additional_properties.mustache @@ -4,7 +4,7 @@ * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ - private Map additionalProperties; + private {{#useJspecify}}@Nullable {{/useJspecify}}Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. @@ -27,7 +27,7 @@ * @return the additional (undeclared) properties */ @JsonAnyGetter - public Map getAdditionalProperties() { + public {{#useJspecify}}@Nullable {{/useJspecify}}Map getAdditionalProperties() { return additionalProperties; } @@ -36,7 +36,7 @@ * @param key the name of the property * @return the additional (undeclared) property with the specified name */ - public {{{.}}} getAdditionalProperty(String key) { + public {{#useJspecify}}{{#lambda.jSpecifyNullable}}@{{javaxPackage}}.annotation.Nullable {{/lambda.jSpecifyNullable}}{{/useJspecify}}{{#lambda.jSpecifyDatatype}}{{{.}}}{{/lambda.jSpecifyDatatype}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pojo.mustache index 9ecd618ac896..56780d543aaf 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/restclient/pojo.mustache @@ -301,7 +301,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v {{/readWriteVars}} {{/parent}} @Override - public boolean equals(Object o) { + public boolean equals({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { {{#useReflectionEqualsHashCode}} return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} @@ -363,7 +363,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v * 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) { + private{{#jsonb}} static{{/jsonb}} String toIndentedString({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } {{#supportUrlQuery}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache index 8e7182792457..e0722a18f356 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/additional_properties.mustache @@ -4,7 +4,7 @@ * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ - private Map additionalProperties; + private {{#useJspecify}}@Nullable {{/useJspecify}}Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. @@ -27,7 +27,7 @@ * @return the additional (undeclared) properties */ @JsonAnyGetter - public Map getAdditionalProperties() { + public {{#useJspecify}}@Nullable {{/useJspecify}}Map getAdditionalProperties() { return additionalProperties; } @@ -36,7 +36,7 @@ * @param key the name of the property * @return the additional (undeclared) property with the specified name */ - public {{{.}}} getAdditionalProperty(String key) { + public {{#useJspecify}}{{#lambda.jSpecifyNullable}}@{{javaxPackage}}.annotation.Nullable {{/lambda.jSpecifyNullable}}{{/useJspecify}}{{#lambda.jSpecifyDatatype}}{{{.}}}{{/lambda.jSpecifyDatatype}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache index 8c438877253d..7a6fd37f08d4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pojo.mustache @@ -301,7 +301,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/readWriteVars}} {{/parent}} @Override - public boolean equals(Object o) { + public boolean equals({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { {{#useReflectionEqualsHashCode}} return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} @@ -363,7 +363,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens * 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) { + private{{#jsonb}} static{{/jsonb}} String toIndentedString({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } {{#supportUrlQuery}} 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 index 8e7182792457..e0722a18f356 100644 --- 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 @@ -4,7 +4,7 @@ * This is a holder for any undeclared properties as specified with * the 'additionalProperties' keyword in the OAS document. */ - private Map additionalProperties; + private {{#useJspecify}}@Nullable {{/useJspecify}}Map additionalProperties; /** * Set the additional (undeclared) property with the specified name and value. @@ -27,7 +27,7 @@ * @return the additional (undeclared) properties */ @JsonAnyGetter - public Map getAdditionalProperties() { + public {{#useJspecify}}@Nullable {{/useJspecify}}Map getAdditionalProperties() { return additionalProperties; } @@ -36,7 +36,7 @@ * @param key the name of the property * @return the additional (undeclared) property with the specified name */ - public {{{.}}} getAdditionalProperty(String key) { + public {{#useJspecify}}{{#lambda.jSpecifyNullable}}@{{javaxPackage}}.annotation.Nullable {{/lambda.jSpecifyNullable}}{{/useJspecify}}{{#lambda.jSpecifyDatatype}}{{{.}}}{{/lambda.jSpecifyDatatype}} getAdditionalProperty(String key) { if (this.additionalProperties == null) { return null; } 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 index 6170edc45cbd..c9145916069b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pojo.mustache @@ -301,7 +301,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v {{/readWriteVars}} {{/parent}} @Override - public boolean equals(Object o) { + public boolean equals({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { {{#useReflectionEqualsHashCode}} return EqualsBuilder.reflectionEquals(this, o, false, null, true); {{/useReflectionEqualsHashCode}} @@ -363,7 +363,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v * 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) { + private{{#jsonb}} static{{/jsonb}} String toIndentedString({{#useJspecify}}@Nullable {{/useJspecify}}Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } {{#supportUrlQuery}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 256c2203428e..221a4f20474d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -5362,6 +5362,47 @@ public Object[][] jspecifyLibraries() { }; } + @DataProvider(name = "jspecifyAdditionalPropertiesLibraries") + public Object[][] jspecifyAdditionalPropertiesLibraries() { + return new Object[][]{{RESTCLIENT}, {WEBCLIENT}, {RESTTEMPLATE}, {NATIVE}, {MICROPROFILE}}; + } + + @Test(dataProvider = "jspecifyAdditionalPropertiesLibraries") + public void testJspecifyNullableAdditionalPropertiesAndObjectParameters(String library) { + final Map files = generateFromContract("src/test/resources/3_0/java/jspecify-additional-properties.yaml", library, + Map.of(USE_JSPECIFY, true, + CodegenConstants.SERIALIZATION_LIBRARY, "jackson", + ANNOTATION_LIBRARY, "none"), + codegenConfigurator -> codegenConfigurator.addTypeMapping("DateTime", "java.time.Instant")); + + JavaFileAssert.assertThat(files.get("Extensible.java")) + .fileContains( + "import org.jspecify.annotations.Nullable;", + "private @Nullable Map additionalProperties;", + "public @Nullable Map getAdditionalProperties()", + "public @Nullable String getAdditionalProperty(String key)", + "public boolean equals(@Nullable Object o)", + "String toIndentedString(@Nullable Object o)"); + // a qualified type takes the annotation on its simple name + JavaFileAssert.assertThat(files.get("ExtensibleWithTimestamps.java")) + .fileContains("public java.time.@Nullable Instant getAdditionalProperty(String key)"); + } + + @Test(dataProvider = "jspecifyAdditionalPropertiesLibraries") + public void testNullableAdditionalPropertiesOnlyWithJspecify(String library) { + final Map files = generateFromContract("src/test/resources/3_0/java/jspecify-additional-properties.yaml", library, + Map.of(CodegenConstants.SERIALIZATION_LIBRARY, "jackson", + ANNOTATION_LIBRARY, "none")); + + JavaFileAssert.assertThat(files.get("Extensible.java")) + .fileContains( + "private Map additionalProperties;", + "public Map getAdditionalProperties()", + "public String getAdditionalProperty(String key)", + "public boolean equals(Object o)", + "String toIndentedString(Object o)"); + } + @Test(dataProvider = "jspecifyLibraries") public void testJspecify(String library, int springBootVersion, boolean hasJspecifyDependency) throws IOException { final Map files = generateFromContract("src/test/resources/3_0/java/jspecify.yaml", library, diff --git a/modules/openapi-generator/src/test/resources/3_0/java/jspecify-additional-properties.yaml b/modules/openapi-generator/src/test/resources/3_0/java/jspecify-additional-properties.yaml new file mode 100644 index 000000000000..a04c1d49941d --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/jspecify-additional-properties.yaml @@ -0,0 +1,32 @@ +openapi: 3.0.3 +info: + title: jspecify additionalProperties + version: 1.0.0 +paths: + /extensible: + get: + operationId: getExtensible + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Extensible' +components: + schemas: + Extensible: + type: object + properties: + name: + type: string + additionalProperties: + type: string + ExtensibleWithTimestamps: + type: object + properties: + name: + type: string + additionalProperties: + type: string + format: date-time diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/FileContent.java index b4f33e014512..0ec5ab54bbf6 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/FileContent.java @@ -128,7 +128,7 @@ public String getName() { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -156,7 +156,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/Foo.java index e5724899af2d..f0afa024fd18 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/Foo.java @@ -441,7 +441,7 @@ public Foo nullableColor(@Nullable String nullableColor) { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -479,7 +479,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index 49db374a7c5f..6457fa3d0568 100644 --- a/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/microprofile-rest-client-3.0-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -191,7 +191,7 @@ public RequiredAndNullable addListItem(String _listItem) { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -221,7 +221,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } } diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java index 01f3ec8e69cd..1c66f15f1e0e 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java @@ -149,7 +149,7 @@ public String getName() { * Return true if this FileContent object is equal to o. */ @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -173,7 +173,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java index 473fe131b3a5..9f0cf82570c5 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java @@ -451,7 +451,7 @@ public void setNullableColor(@Nullable String nullableColor) { * Return true if this Foo object is equal to o. */ @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -485,7 +485,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index 403f4a2a1fb4..800fe7530bd5 100644 --- a/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/native-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -201,7 +201,7 @@ public void setList(@Nullable List _list) { * Return true if this RequiredAndNullable object is equal to o. */ @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @@ -227,7 +227,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/FileContent.java index 5b93588b6902..64f6e4e748f1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/FileContent.java @@ -142,7 +142,7 @@ public String getName() { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -175,7 +175,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/Foo.java index bc031cded6da..5f9079ab8f43 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/Foo.java @@ -523,7 +523,7 @@ public void setNullableColor(@Nullable String nullableColor) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -587,7 +587,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index 61437e21e892..5747cb4d2829 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify-openapiNullable/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -209,7 +209,7 @@ public void setList(@Nullable List _list) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -246,7 +246,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java index 5b93588b6902..64f6e4e748f1 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java @@ -142,7 +142,7 @@ public String getName() { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -175,7 +175,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java index b9bef4d54ffa..1cd98e6d3ad8 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java @@ -475,7 +475,7 @@ public void setNullableColor(@Nullable String nullableColor) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -528,7 +528,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index 61437e21e892..5747cb4d2829 100644 --- a/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -209,7 +209,7 @@ public void setList(@Nullable List _list) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -246,7 +246,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java index 5b93588b6902..64f6e4e748f1 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java @@ -142,7 +142,7 @@ public String getName() { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -175,7 +175,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java index b9bef4d54ffa..1cd98e6d3ad8 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java @@ -475,7 +475,7 @@ public void setNullableColor(@Nullable String nullableColor) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -528,7 +528,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index 61437e21e892..5747cb4d2829 100644 --- a/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/resttemplate-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -209,7 +209,7 @@ public void setList(@Nullable List _list) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -246,7 +246,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java index 5cc640667822..0813a0fade62 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/FileContent.java @@ -141,7 +141,7 @@ public String getName() { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -174,7 +174,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java index 85f9680cac00..2bf90b4a6dd1 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/Foo.java @@ -474,7 +474,7 @@ public void setNullableColor(@Nullable String nullableColor) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -527,7 +527,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); } diff --git a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java index ef0d39c3d15c..61cb5d6e4105 100644 --- a/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java +++ b/samples/client/petstore/java/webclient-springBoot4-jackson3-jspecify/src/main/java/org/openapitools/client/model/RequiredAndNullable.java @@ -208,7 +208,7 @@ public void setList(@Nullable List _list) { @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; } @@ -245,7 +245,7 @@ public String toString() { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(@Nullable Object o) { return o == null ? "null" : o.toString().replace("\n", "\n "); }