diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 47b1fd30dae0..09584107201b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -154,6 +154,12 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{^lombok.Data}} {{! 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}}) { {{#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 +171,12 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} } {{#isArray}} + {{#deprecated}} + /** + * @deprecated + */ + @Deprecated + {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { @@ -183,6 +195,12 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{/isArray}} {{#isMap}} + {{#deprecated}} + /** + * @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 +288,24 @@ 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}}) { super.{{name}}({{name}}); return this; } {{#isArray}} + {{#deprecated}} + /** + * @deprecated + */ + @Deprecated + {{/deprecated}} public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { super.add{{nameInPascalCase}}Item({{name}}Item); return this; @@ -283,6 +313,12 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}} {{/isArray}} {{#isMap}} + {{#deprecated}} + /** + * @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..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 @@ -3254,6 +3254,48 @@ 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")) + .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() + .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..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,11 +161,19 @@ 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) { 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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public Pet addTagsItem(Tag tagsItem) { } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setTags(List<@Valid Tag> tags) { this.tags = tags; } + /** + * @deprecated + */ + @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..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,10 @@ public void setUuid(@Nullable String uuid) { this.uuid = uuid; } + /** + * @deprecated + */ + @Deprecated public ObjectWithDeprecatedFieldsDto id(@Nullable BigDecimal id) { this.id = id; return this; @@ -93,6 +97,10 @@ public void setId(@Nullable BigDecimal id) { this.id = id; } + /** + * @deprecated + */ + @Deprecated public ObjectWithDeprecatedFieldsDto deprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { this.deprecatedRef = deprecatedRef; return this; @@ -120,11 +128,19 @@ 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) { 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..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,10 @@ public void setTags(List<@Valid TagDto> tags) { this.tags = tags; } + /** + * @deprecated + */ + @Deprecated public PetDto status(@Nullable StatusEnum status) { this.status = status; return this;