diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml
index a3bc9a094b2..2ead09e5957 100644
--- a/.github/workflows/samples-spring.yaml
+++ b/.github/workflows/samples-spring.yaml
@@ -3,10 +3,16 @@ name: Samples Java Spring
on:
push:
paths:
+ # clients
+ - 'samples/client/petstore/spring*/**'
+ # servers
- 'samples/server/petstore/spring*/**'
- 'samples/openapi3/server/petstore/spring*/**'
pull_request:
paths:
+ # clients
+ - 'samples/client/petstore/spring*/**'
+ # servers
- 'samples/server/petstore/spring*/**'
- 'samples/openapi3/server/petstore/spring*/**'
jobs:
@@ -27,6 +33,7 @@ jobs:
- samples/openapi3/client/petstore/spring-cloud-async
- samples/openapi3/client/petstore/spring-cloud-spring-pageable
- samples/client/petstore/spring-cloud-tags
+ - samples/client/petstore/spring-cloud-deprecated
# servers
- samples/server/petstore/springboot
- samples/openapi3/server/petstore/springboot
diff --git a/bin/configs/spring-cloud-deprecated-oas3.yaml b/bin/configs/spring-cloud-deprecated-oas3.yaml
new file mode 100644
index 00000000000..b6d1943ce7a
--- /dev/null
+++ b/bin/configs/spring-cloud-deprecated-oas3.yaml
@@ -0,0 +1,13 @@
+generatorName: spring
+library: spring-cloud
+outputDir: samples/client/petstore/spring-cloud-deprecated
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ groupId: org.openapitools.openapi3
+ documentationProvider: springdoc
+ artifactId: spring-cloud-deprecated
+ interfaceOnly: "true"
+ singleContentTypes: "true"
+ hideGenerationTimestamp: "true"
+ useTags: "true"
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
index 6dea8c3ccd4..743e188c8e3 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
@@ -161,6 +161,9 @@ public interface {{classname}} {
{{#notes}}
description = "{{{.}}}",
{{/notes}}
+ {{#isDeprecated}}
+ deprecated = true,
+ {{/isDeprecated}}
{{#vendorExtensions.x-tags.size}}
tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
{{/vendorExtensions.x-tags.size}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache
index 24c8a7a4f61..c546f9c4e90 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/paramDoc.mustache
@@ -1 +1 @@
-{{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#isPathParam}}, in = ParameterIn.PATH{{/isPathParam}}{{#isQueryParam}}, in = ParameterIn.QUERY{{/isQueryParam}}{{#isCookieParam}}, in = ParameterIn.COOKIE{{/isCookieParam}}{{#isHeaderParam}}, in = ParameterIn.HEADER{{/isHeaderParam}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}}
\ No newline at end of file
+{{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}"{{#isDeprecated}}, deprecated = true{{/isDeprecated}}, description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#isPathParam}}, in = ParameterIn.PATH{{/isPathParam}}{{#isQueryParam}}, in = ParameterIn.QUERY{{/isQueryParam}}{{#isCookieParam}}, in = ParameterIn.COOKIE{{/isCookieParam}}{{#isHeaderParam}}, in = ParameterIn.HEADER{{/isHeaderParam}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache
index 16888518c1b..a0ce56314d1 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache
@@ -1 +1 @@
-{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}
\ No newline at end of file
+{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
index 0ab7f1479ec..00325ac472c 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
@@ -1,13 +1,17 @@
/**
- * {{description}}{{^description}}{{classname}}{{/description}}
+ * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}}
+ * @deprecated{{/isDeprecated}}
*/
{{>additionalModelTypeAnnotations}}
{{#description}}
+{{#isDeprecated}}
+@Deprecated
+{{/isDeprecated}}
{{#swagger1AnnotationLibrary}}
@ApiModel(description = "{{{description}}}")
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
-@Schema({{#name}}name = "{{name}}", {{/name}}description = "{{{description}}}")
+@Schema({{#name}}name = "{{name}}", {{/name}}description = "{{{description}}}"{{#deprecated}}, deprecated = true{{/deprecated}})
{{/swagger2AnnotationLibrary}}
{{/description}}
{{#discriminator}}
@@ -55,6 +59,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{/vendorExtensions.x-field-extra-annotation}}
+ {{#deprecated}}
+ @Deprecated
+ {{/deprecated}}
{{#isContainer}}
{{#useBeanValidation}}@Valid{{/useBeanValidation}}
{{#openApiNullable}}
@@ -163,6 +170,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
* maximum: {{.}}
{{/maximum}}
* @return {{name}}
+ {{#deprecated}}
+ * @deprecated
+ {{/deprecated}}
*/
{{#vendorExtensions.x-extra-annotation}}
{{{vendorExtensions.x-extra-annotation}}}
@@ -174,7 +184,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#required}}@NotNull{{/required}}
{{/useBeanValidation}}
{{#swagger2AnnotationLibrary}}
- @Schema(name = "{{{baseName}}}"{{#isReadOnly}}, accessMode = Schema.AccessMode.READ_ONLY{{/isReadOnly}}{{#example}}, example = "{{{.}}}"{{/example}}{{#description}}, description = "{{{.}}}"{{/description}}, requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}})
+ @Schema(name = "{{{baseName}}}"{{#isReadOnly}}, accessMode = Schema.AccessMode.READ_ONLY{{/isReadOnly}}{{#example}}, example = "{{{.}}}"{{/example}}{{#description}}, description = "{{{.}}}"{{/description}}{{#deprecated}}, deprecated = true{{/deprecated}}, requiredMode = {{#required}}Schema.RequiredMode.REQUIRED{{/required}}{{^required}}Schema.RequiredMode.NOT_REQUIRED{{/required}})
{{/swagger2AnnotationLibrary}}
{{#swagger1AnnotationLibrary}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}")
@@ -182,13 +192,24 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#jackson}}
@JsonProperty("{{baseName}}")
{{/jackson}}
+ {{#deprecated}}
+ @Deprecated
+ {{/deprecated}}
public {{>nullableDataType}} {{getter}}() {
return {{name}};
}
+ {{#deprecated}}
+ /**
+ * @deprecated
+ */
+ {{/deprecated}}
{{#vendorExtensions.x-setter-extra-annotation}}
{{{vendorExtensions.x-setter-extra-annotation}}}
{{/vendorExtensions.x-setter-extra-annotation}}
+ {{#deprecated}}
+ @Deprecated
+ {{/deprecated}}
public void {{setter}}({{>nullableDataType}} {{name}}) {
this.{{name}} = {{name}};
}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache
index 6b78fb343f7..1b7fac3512e 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache
@@ -1 +1 @@
-{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}}
\ No newline at end of file
+{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
index 0cc32cc1ad4..89ef9d88cec 100644
--- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
+++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-deprecated-fields.yaml
@@ -144,6 +144,7 @@ paths:
operationId: getPetById
parameters:
- name: petId
+ deprecated: true
in: path
description: ID of pet to return
required: true
@@ -426,6 +427,7 @@ paths:
pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$'
- name: password
in: query
+ deprecated: true
description: The password for login in clear text
required: true
schema:
diff --git a/samples/client/petstore/spring-cloud-deprecated/.openapi-generator-ignore b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/FILES
new file mode 100644
index 00000000000..5e5e7f60456
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/FILES
@@ -0,0 +1,11 @@
+README.md
+pom.xml
+src/main/java/org/openapitools/api/PetApi.java
+src/main/java/org/openapitools/api/StoreApi.java
+src/main/java/org/openapitools/api/UserApi.java
+src/main/java/org/openapitools/model/Category.java
+src/main/java/org/openapitools/model/ModelApiResponse.java
+src/main/java/org/openapitools/model/Order.java
+src/main/java/org/openapitools/model/Pet.java
+src/main/java/org/openapitools/model/Tag.java
+src/main/java/org/openapitools/model/User.java
diff --git a/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/VERSION
new file mode 100644
index 00000000000..44bad91b171
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.0.1-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/spring-cloud-deprecated/README.md b/samples/client/petstore/spring-cloud-deprecated/README.md
new file mode 100644
index 00000000000..a462be951ac
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/README.md
@@ -0,0 +1,26 @@
+# OpenAPI generated API stub
+
+Spring Framework stub
+
+
+## Overview
+This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
+This is an example of building API stub interfaces in Java using the Spring framework.
+
+The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
+by adding ```@Controller``` classes that implement the interface. Eg:
+```java
+@Controller
+public class PetController implements PetApi {
+// implement all PetApi methods
+}
+```
+
+You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg:
+```java
+@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
+public interface PetClient extends PetApi {
+
+}
+```
diff --git a/samples/client/petstore/spring-cloud-deprecated/pom.xml b/samples/client/petstore/spring-cloud-deprecated/pom.xml
new file mode 100644
index 00000000000..d7d770f1e2a
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/pom.xml
@@ -0,0 +1,82 @@
+
+ 4.0.0
+ org.openapitools.openapi3
+ spring-cloud-deprecated
+ jar
+ spring-cloud-deprecated
+ 1.0.0
+
+ 1.8
+ ${java.version}
+ ${java.version}
+ UTF-8
+ 1.6.14
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.6
+
+
+
+ src/main/java
+
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-parent
+ 2021.0.5
+ pom
+ import
+
+
+
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
+
+
+
+ com.google.code.findbugs
+ jsr305
+ 3.0.2
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+ org.springframework.security
+ spring-security-oauth2-client
+ 5.7.8
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+ org.openapitools
+ jackson-databind-nullable
+ 0.2.6
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework.data
+ spring-data-commons
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java
new file mode 100644
index 00000000000..ca73e5cf597
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java
@@ -0,0 +1,308 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.1-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import org.openapitools.model.ModelApiResponse;
+import org.openapitools.model.Pet;
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import javax.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
+@Validated
+@Tag(name = "pet", description = "Everything about your Pets")
+public interface PetApi {
+
+ /**
+ * POST /pet : Add a new pet to the store
+ *
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @return Invalid input (status code 405)
+ */
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = "/pet",
+ consumes = "application/json"
+ )
+ ResponseEntity addPet(
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ );
+
+
+ /**
+ * DELETE /pet/{petId} : Deletes a pet
+ *
+ *
+ * @param petId Pet id to delete (required)
+ * @param apiKey (optional)
+ * @return Invalid pet value (status code 400)
+ */
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.DELETE,
+ value = "/pet/{petId}"
+ )
+ ResponseEntity deletePet(
+ @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey
+ );
+
+
+ /**
+ * GET /pet/findByStatus : Finds Pets by status
+ * Multiple status values can be provided with comma separated strings
+ *
+ * @param status Status values that need to be considered for filter (required)
+ * @return successful operation (status code 200)
+ * or Invalid status value (status code 400)
+ */
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
+ @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid status value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = "/pet/findByStatus",
+ produces = "application/json"
+ )
+ ResponseEntity> findPetsByStatus(
+ @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status
+ );
+
+
+ /**
+ * GET /pet/findByTags : Finds Pets by tags
+ * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ *
+ * @param tags Tags to filter by (required)
+ * @return successful operation (status code 200)
+ * or Invalid tag value (status code 400)
+ * @deprecated
+ */
+ @Deprecated
+ @Operation(
+ operationId = "findPetsByTags",
+ summary = "Finds Pets by tags",
+ description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
+ deprecated = true,
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
+ @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid tag value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = "/pet/findByTags",
+ produces = "application/json"
+ )
+ ResponseEntity> findPetsByTags(
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags
+ );
+
+
+ /**
+ * GET /pet/{petId} : Find pet by ID
+ * Returns a single pet
+ *
+ * @param petId ID of pet to return (required)
+ * @return successful operation (status code 200)
+ * or Invalid ID supplied (status code 400)
+ * or Pet not found (status code 404)
+ */
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Pet not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = "/pet/{petId}",
+ produces = "application/json"
+ )
+ ResponseEntity getPetById(
+ @Parameter(name = "petId", deprecated = true, description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") @Deprecated Long petId
+ );
+
+
+ /**
+ * PUT /pet : Update an existing pet
+ *
+ *
+ * @param pet Pet object that needs to be added to the store (required)
+ * @return Invalid ID supplied (status code 400)
+ * or Pet not found (status code 404)
+ * or Validation exception (status code 405)
+ */
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Pet not found"),
+ @ApiResponse(responseCode = "405", description = "Validation exception")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.PUT,
+ value = "/pet",
+ consumes = "application/json"
+ )
+ ResponseEntity updatePet(
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ );
+
+
+ /**
+ * POST /pet/{petId} : Updates a pet in the store with form data
+ *
+ *
+ * @param petId ID of pet that needs to be updated (required)
+ * @param name Updated name of the pet (optional)
+ * @param status Updated status of the pet (optional)
+ * @return Invalid input (status code 405)
+ */
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = "/pet/{petId}",
+ consumes = "application/x-www-form-urlencoded"
+ )
+ ResponseEntity updatePetWithForm(
+ @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
+ @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
+ );
+
+
+ /**
+ * POST /pet/{petId}/uploadImage : uploads an image
+ *
+ *
+ * @param petId ID of pet to update (required)
+ * @param additionalMetadata Additional data to pass to server (optional)
+ * @param file file to upload (optional)
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
+ description = "",
+ tags = { "pet" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.POST,
+ value = "/pet/{petId}/uploadImage",
+ produces = "application/json",
+ consumes = "multipart/form-data"
+ )
+ ResponseEntity uploadFile(
+ @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
+ @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ );
+
+}
diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java
new file mode 100644
index 00000000000..d856ce6a336
--- /dev/null
+++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java
@@ -0,0 +1,162 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.1-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.api;
+
+import java.util.Map;
+import org.openapitools.model.Order;
+import io.swagger.v3.oas.annotations.ExternalDocumentation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.context.request.NativeWebRequest;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import javax.validation.constraints.*;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import javax.annotation.Generated;
+
+@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
+@Validated
+@Tag(name = "store", description = "Access to Petstore orders")
+public interface StoreApi {
+
+ /**
+ * DELETE /store/order/{orderId} : Delete purchase order by ID
+ * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ *
+ * @param orderId ID of the order that needs to be deleted (required)
+ * @return Invalid ID supplied (status code 400)
+ * or Order not found (status code 404)
+ */
+ @Operation(
+ operationId = "deleteOrder",
+ summary = "Delete purchase order by ID",
+ description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.DELETE,
+ value = "/store/order/{orderId}"
+ )
+ ResponseEntity deleteOrder(
+ @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
+ );
+
+
+ /**
+ * GET /store/inventory : Returns pet inventories by status
+ * Returns a map of status codes to quantities
+ *
+ * @return successful operation (status code 200)
+ */
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
+ tags = { "store" },
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
+ )
+ @RequestMapping(
+ method = RequestMethod.GET,
+ value = "/store/inventory",
+ produces = "application/json"
+ )
+ ResponseEntity