From bf615f6e629cf195ad260ad7f1c9ea4d272693e1 Mon Sep 17 00:00:00 2001 From: Burak KALAYCI Date: Fri, 14 Aug 2026 12:08:07 +0300 Subject: [PATCH 1/2] [Java][Spring] Annotate deprecated fluent model setters with @Deprecated Fluent setters and collection helpers generated from deprecated schema properties now emit @Deprecated, matching getters, setters, and nested builder methods. Fixes #24704 --- .../main/resources/JavaSpring/pojo.mustache | 18 ++++++++++ .../java/spring/SpringCodegenTest.java | 35 +++++++++++++++++++ .../resources/3_0/spring/issue_24704.yaml | 35 +++++++++++++++++++ .../main/java/org/openapitools/model/Pet.java | 2 ++ .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../java/org/openapitools/model/PetDto.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../main/java/org/openapitools/model/Pet.java | 1 + .../org/openapitools/virtualan/model/Pet.java | 1 + .../model/ObjectWithDeprecatedFieldsDto.java | 4 +++ .../java/org/openapitools/model/PetDto.java | 1 + 50 files changed, 139 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/issue_24704.yaml diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 47b1fd30dae0..8094daddfc58 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -154,6 +154,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{^lombok.Data}} {{! begin feature: fluent setter methods }} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{#useJspecify}}{{#lambda.jSpecifyNullable}}{{^required}}{{^useOptional}}@Nullable {{/useOptional}}{{#useOptional}}{{#optionalAcceptNullable}}@Nullable {{/optionalAcceptNullable}}{{/useOptional}}{{/required}}{{/lambda.jSpecifyNullable}}{{#lambda.jSpecifyDatatype}}{{{datatypeWithEnum}}}{{/lambda.jSpecifyDatatype}}{{/useJspecify}}{{^useJspecify}}{{>nullableAnnotation_default}}{{{datatypeWithEnum}}}{{/useJspecify}} {{name}}) { {{#openApiNullable}} this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.of{{#optionalAcceptNullable}}Nullable{{/optionalAcceptNullable}}({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}; @@ -165,6 +168,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} } {{#isArray}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { @@ -183,6 +189,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{/isArray}} {{#isMap}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { @@ -270,12 +279,18 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{^lombok.Setter}} {{! begin feature: fluent setter methods for inherited properties }} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { super.{{name}}({{name}}); return this; } {{#isArray}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { super.add{{nameInPascalCase}}Item({{name}}Item); return this; @@ -283,6 +298,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{/isArray}} {{#isMap}} + {{#deprecated}} + @Deprecated + {{/deprecated}} public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { super.put{{nameInPascalCase}}Item(key, {{name}}Item); return this; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index e5c1ad926aa6..4203afdf4a7b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -3254,6 +3254,41 @@ public void contractWithDeprecatedEnumGeneratesDeprecatedAnnotation() throws IOE .fileDoesNotContain("@Deprecated"); } + @Test + public void contractWithDeprecatedPropertiesAnnotatesFluentSettersAndCollectionHelpers() throws IOException { + Map output = generateFromContract( + "src/test/resources/3_0/spring/issue_24704.yaml", + SPRING_BOOT, + Map.of(GENERATE_BUILDERS, true) + ); + + JavaFileAssert.assertThat(output.get("Example.java")) + .assertMethod("deprecatedProperty", "String") + .hasAnnotation("Deprecated") + .toFileAssert() + .assertMethod("deprecatedValues") + .hasAnnotation("Deprecated") + .toFileAssert() + .assertMethod("deprecatedMap") + .hasAnnotation("Deprecated") + .toFileAssert() + .assertMethod("addDeprecatedValuesItem", "String") + .hasAnnotation("Deprecated") + .toFileAssert() + .assertMethod("putDeprecatedMapItem", "String", "String") + .hasAnnotation("Deprecated") + .toFileAssert() + .assertMethod("currentProperty", "String") + .doesNotHaveAnnotation("Deprecated") + .toFileAssert() + .assertInnerClass("Builder") + .assertMethod("deprecatedProperty", "String") + .hasAnnotation("Deprecated") + .toInnerClassAssert() + .assertMethod("currentProperty", "String") + .doesNotHaveAnnotation("Deprecated"); + } + @Test public void contractWithResolvedInnerEnumContainsEnumConverter() throws IOException { File output = Files.createTempDirectory("test").toFile(); diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/issue_24704.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24704.yaml new file mode 100644 index 000000000000..f1872d6643e8 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/issue_24704.yaml @@ -0,0 +1,35 @@ +openapi: 3.0.3 +info: + title: Deprecated property example + version: 1.0.0 +paths: + /example: + get: + operationId: getExample + responses: + "200": + description: Example response + content: + application/json: + schema: + $ref: "#/components/schemas/Example" +components: + schemas: + Example: + type: object + properties: + currentProperty: + type: string + deprecatedProperty: + type: string + deprecated: true + deprecatedValues: + type: array + deprecated: true + items: + type: string + deprecatedMap: + type: object + deprecated: true + additionalProperties: + type: string diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java index 53b64044c6e3..06afff132f2e 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java @@ -161,11 +161,13 @@ public void setName(JsonNullable name) { this.name = name; } + @Deprecated public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + @Deprecated public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { this.photoUrls = new ArrayList<>(); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java index aed326d47e76..cd38ca44840e 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java @@ -212,6 +212,7 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java index 5b62a26b9fd8..3c4e9fd6ce0d 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java @@ -211,6 +211,7 @@ public void setTags(List tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 364eb0af3c0c..9092e36193c3 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -212,6 +212,7 @@ public void setTags(List tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java index aa5696d9edff..7012e5d1f1c9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java @@ -218,6 +218,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 9e4323f1115c..fa0634c9f6f8 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,7 @@ public void setTags(List tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 9e4323f1115c..fa0634c9f6f8 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,7 @@ public void setTags(List tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java index e9d00a6b6f2d..31305bad2ea9 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java @@ -218,6 +218,7 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java index 12be472e2153..0b81ca09f1a8 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java @@ -219,6 +219,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 5b62a26b9fd8..3c4e9fd6ce0d 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -211,6 +211,7 @@ public void setTags(List tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index 1f283da5f8b7..acf4db8f9287 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(StatusEnum status) { this.status = Optional.ofNullable(status); return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index 988c42ca95f9..a6b9775ded7c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -219,6 +219,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index c5deb2f1e1ee..ebcaf44c57fc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -216,6 +216,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java index adbd3ac4721e..1ad75f928181 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java @@ -262,6 +262,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index 69f5479e14e2..c047d2447f5e 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -261,6 +261,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java index 7f0a042f672f..aab5f8f0a605 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java @@ -267,6 +267,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index 6bc756d1c1e1..301d06212774 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 2d94237930ba..2b0e4ab05ac5 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index e5a470f46246..82b37f676932 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -229,6 +229,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 3d98449a58d6..c4919550b0de 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -236,6 +236,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index b88a12a9449a..0039650dca5a 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 60155272ecbc..369154920aae 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java index 36dfb19c7c1d..741813641cfb 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java @@ -226,6 +226,7 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java index 694d9419602f..ec4d20bedee4 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java @@ -151,6 +151,7 @@ public Pet addTagsItem(Tag tagsItem) { } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java index dcc9864ef5fa..0f48e4a0591a 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 2c9687e5a1fb..fb26a4144e77 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 0f8f2c76f2da..b02427ea235e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(StatusEnum status) { this.status = Optional.ofNullable(status); return this; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index b839dc0b136c..b947ca315535 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -224,6 +224,7 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; return this; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java index 20fcb7e81930..356d340ba5e0 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java @@ -66,6 +66,7 @@ public void setUuid(@Nullable String uuid) { this.uuid = uuid; } + @Deprecated public ObjectWithDeprecatedFieldsDto id(@Nullable BigDecimal id) { this.id = id; return this; @@ -93,6 +94,7 @@ public void setId(@Nullable BigDecimal id) { this.id = id; } + @Deprecated public ObjectWithDeprecatedFieldsDto deprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { this.deprecatedRef = deprecatedRef; return this; @@ -120,11 +122,13 @@ public void setDeprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { this.deprecatedRef = deprecatedRef; } + @Deprecated public ObjectWithDeprecatedFieldsDto bars(List bars) { this.bars = bars; return this; } + @Deprecated public ObjectWithDeprecatedFieldsDto addBarsItem(String barsItem) { if (this.bars == null) { this.bars = new ArrayList<>(); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 50a0ab6923f5..0a0344a23c0c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -227,6 +227,7 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this; From 0cbc5814949ab5d22256cdef604d7f8c232d8854 Mon Sep 17 00:00:00 2001 From: Burak KALAYCI Date: Tue, 18 Aug 2026 06:43:03 +0300 Subject: [PATCH 2/2] [Java][Spring] Add @deprecated javadoc on fluent setters Keep generated fluent setters and collection helpers consistent with getters/setters for deprecated properties. --- .../main/resources/JavaSpring/pojo.mustache | 18 ++++++++++++++++++ .../codegen/java/spring/SpringCodegenTest.java | 7 +++++++ .../main/java/org/openapitools/model/Pet.java | 6 ++++++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../java/org/openapitools/model/PetDto.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../main/java/org/openapitools/model/Pet.java | 3 +++ .../org/openapitools/virtualan/model/Pet.java | 3 +++ .../model/ObjectWithDeprecatedFieldsDto.java | 12 ++++++++++++ .../java/org/openapitools/model/PetDto.java | 3 +++ 49 files changed, 178 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 8094daddfc58..09584107201b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -155,6 +155,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{! begin feature: fluent setter methods }} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} {{name}}({{#useJspecify}}{{#lambda.jSpecifyNullable}}{{^required}}{{^useOptional}}@Nullable {{/useOptional}}{{#useOptional}}{{#optionalAcceptNullable}}@Nullable {{/optionalAcceptNullable}}{{/useOptional}}{{/required}}{{/lambda.jSpecifyNullable}}{{#lambda.jSpecifyDatatype}}{{{datatypeWithEnum}}}{{/lambda.jSpecifyDatatype}}{{/useJspecify}}{{^useJspecify}}{{>nullableAnnotation_default}}{{{datatypeWithEnum}}}{{/useJspecify}} {{name}}) { @@ -169,6 +172,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#isArray}} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { @@ -190,6 +196,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#isMap}} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { @@ -280,6 +289,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{^lombok.Setter}} {{! begin feature: fluent setter methods for inherited properties }} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -289,6 +301,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#isArray}} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { @@ -299,6 +314,9 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{#isMap}} {{#deprecated}} + /** + * @deprecated + */ @Deprecated {{/deprecated}} public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 4203afdf4a7b..36783079ce77 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -3263,6 +3263,13 @@ public void contractWithDeprecatedPropertiesAnnotatesFluentSettersAndCollectionH ); JavaFileAssert.assertThat(output.get("Example.java")) + .fileContains( + " /**\n * @deprecated\n */\n @Deprecated\n public Example deprecatedProperty(", + " /**\n * @deprecated\n */\n @Deprecated\n public Example deprecatedValues(", + " /**\n * @deprecated\n */\n @Deprecated\n public Example addDeprecatedValuesItem(", + " /**\n * @deprecated\n */\n @Deprecated\n public Example deprecatedMap(", + " /**\n * @deprecated\n */\n @Deprecated\n public Example putDeprecatedMapItem(" + ) .assertMethod("deprecatedProperty", "String") .hasAnnotation("Deprecated") .toFileAssert() diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java index 06afff132f2e..173b7ee53b8b 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/model/Pet.java @@ -161,12 +161,18 @@ public void setName(JsonNullable name) { this.name = name; } + /** + * @deprecated + */ @Deprecated public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } + /** + * @deprecated + */ @Deprecated public Pet addPhotoUrlsItem(String photoUrlsItem) { if (this.photoUrls == null) { diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java index cd38ca44840e..03ebfb1cf338 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/model/PetDto.java @@ -212,6 +212,9 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java index 3c4e9fd6ce0d..f495c7209958 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model/PetDto.java @@ -211,6 +211,9 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java index 9092e36193c3..cac22ea98e1c 100644 --- a/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-oauth/src/main/java/org/openapitools/model/PetDto.java @@ -212,6 +212,9 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java index 7012e5d1f1c9..f72e0c8928ee 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/model/Pet.java @@ -218,6 +218,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index fa0634c9f6f8..a227eb2c2dab 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,9 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index fa0634c9f6f8..a227eb2c2dab 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,9 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java index 31305bad2ea9..4db2d31e6f25 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/model/PetDto.java @@ -218,6 +218,9 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java index 0b81ca09f1a8..bf4de6fa5db9 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model/Pet.java @@ -219,6 +219,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 3c4e9fd6ce0d..f495c7209958 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -211,6 +211,9 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java index acf4db8f9287..1c65c26423ed 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(StatusEnum status) { this.status = Optional.ofNullable(status); diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java index a6b9775ded7c..9d5d17a86137 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/model/Pet.java @@ -219,6 +219,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index ebcaf44c57fc..c4ecfb845193 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -216,6 +216,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java index 1ad75f928181..9734fad43a4c 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/model/Pet.java @@ -262,6 +262,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index c047d2447f5e..f113030d47aa 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -261,6 +261,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java index aab5f8f0a605..7c489b1312c5 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/model/Pet.java @@ -267,6 +267,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index 301d06212774..2d3d8fce88fb 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index 2b0e4ab05ac5..4aa77323c010 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -217,6 +217,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 82b37f676932..2c42eb819ddf 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -229,6 +229,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index c4919550b0de..3364a8d55449 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -236,6 +236,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index 0039650dca5a..bbc849dce37d 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -214,6 +214,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 369154920aae..5bd076bf21d9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java index 741813641cfb..f156c1c317e5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java @@ -226,6 +226,9 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java index ec4d20bedee4..871de5ea1e75 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/model/Pet.java @@ -151,6 +151,9 @@ public Pet addTagsItem(Tag tagsItem) { } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java index 0f48e4a0591a..c887a42c90aa 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/model/Pet.java @@ -221,6 +221,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index fb26a4144e77..2f6eb4a6b5ab 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index b02427ea235e..25b74727ccfa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(StatusEnum status) { this.status = Optional.ofNullable(status); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index b947ca315535..501029312d28 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -224,6 +224,9 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public Pet status(@Nullable StatusEnum status) { this.status = status; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java index 356d340ba5e0..a0491698e411 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java @@ -66,6 +66,9 @@ public void setUuid(@Nullable String uuid) { this.uuid = uuid; } + /** + * @deprecated + */ @Deprecated public ObjectWithDeprecatedFieldsDto id(@Nullable BigDecimal id) { this.id = id; @@ -94,6 +97,9 @@ public void setId(@Nullable BigDecimal id) { this.id = id; } + /** + * @deprecated + */ @Deprecated public ObjectWithDeprecatedFieldsDto deprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { this.deprecatedRef = deprecatedRef; @@ -122,12 +128,18 @@ public void setDeprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { this.deprecatedRef = deprecatedRef; } + /** + * @deprecated + */ @Deprecated public ObjectWithDeprecatedFieldsDto bars(List bars) { this.bars = bars; return this; } + /** + * @deprecated + */ @Deprecated public ObjectWithDeprecatedFieldsDto addBarsItem(String barsItem) { if (this.bars == null) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 0a0344a23c0c..4cdda56930b1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -227,6 +227,9 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status;