diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml
index 718b0a87e9d0..408849f7eec6 100644
--- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml
+++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml
@@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
- documentationProvider: springfox
+ #documentationProvider: springdoc
java8: "false"
useBeanValidation: true
artifactId: spring-boot-beanvalidation-no-nullable
diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml
index b43f22721a1b..4a8904341cbd 100644
--- a/bin/configs/spring-boot-beanvalidation.yaml
+++ b/bin/configs/spring-boot-beanvalidation.yaml
@@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
useSwaggerUI: false
java8: true
useBeanValidation: true
diff --git a/bin/configs/spring-boot-builtin-validation.yaml b/bin/configs/spring-boot-builtin-validation.yaml
index a645153158f9..8a070a7f278e 100644
--- a/bin/configs/spring-boot-builtin-validation.yaml
+++ b/bin/configs/spring-boot-builtin-validation.yaml
@@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
useSwaggerUI: false
java8: true
useBeanValidation: true
diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml
index be11dd0dec01..1561840073a0 100644
--- a/bin/configs/spring-boot-delegate-j8.yaml
+++ b/bin/configs/spring-boot-delegate-j8.yaml
@@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate-j8
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
artifactId: springboot-delegate-j8
hideGenerationTimestamp: "true"
delegatePattern: "true"
diff --git a/bin/configs/spring-boot-delegate-no-response-entity.yaml b/bin/configs/spring-boot-delegate-no-response-entity.yaml
index f8b5cdd3c35f..13d062eb01c9 100644
--- a/bin/configs/spring-boot-delegate-no-response-entity.yaml
+++ b/bin/configs/spring-boot-delegate-no-response-entity.yaml
@@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate-no-response-entity
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
artifactId: springboot-delegate-no-response-entity
hideGenerationTimestamp: "true"
java8: true
diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml
index cf5e016cdbf8..5edcca222c49 100644
--- a/bin/configs/spring-boot-delegate.yaml
+++ b/bin/configs/spring-boot-delegate.yaml
@@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot-delegate
hideGenerationTimestamp: "true"
java8: true
diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml
index b9a1a81c146f..5a95d237e5fb 100644
--- a/bin/configs/spring-boot-implicitHeaders.yaml
+++ b/bin/configs/spring-boot-implicitHeaders.yaml
@@ -4,6 +4,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: springboot-implicitHeaders
- documentationProvider: springfox
+ documentationProvider: springdoc
hideGenerationTimestamp: "true"
implicitHeadersRegex: .*
diff --git a/bin/configs/spring-boot-include-http-request-context.yaml b/bin/configs/spring-boot-include-http-request-context.yaml
index 00701dce3193..a52eeaf879a7 100644
--- a/bin/configs/spring-boot-include-http-request-context.yaml
+++ b/bin/configs/spring-boot-include-http-request-context.yaml
@@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot-include-http-request-context
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-boot-reactive-noResponseEntity.yaml b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
index 1e7ec4815201..f69ad9806c5c 100644
--- a/bin/configs/spring-boot-reactive-noResponseEntity.yaml
+++ b/bin/configs/spring-boot-reactive-noResponseEntity.yaml
@@ -5,7 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive-noResponseEntity
- documentationProvider: springfox
+ documentationProvider: springdoc
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml
index ed5a1e56239e..5bc52f55edda 100644
--- a/bin/configs/spring-boot-reactive.yaml
+++ b/bin/configs/spring-boot-reactive.yaml
@@ -5,7 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive
- documentationProvider: springfox
+ documentationProvider: springdoc
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"
diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml
index 82530260d677..daf57fe87351 100644
--- a/bin/configs/spring-boot-useoptional.yaml
+++ b/bin/configs/spring-boot-useoptional.yaml
@@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
- documentationProvider: springfox
+ #documentationProvider: springdoc
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-boot-x-implements-skip.yaml b/bin/configs/spring-boot-x-implements-skip.yaml
index de98b7027120..a56794db3de8 100644
--- a/bin/configs/spring-boot-x-implements-skip.yaml
+++ b/bin/configs/spring-boot-x-implements-skip.yaml
@@ -4,7 +4,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
additionalNotNullAnnotations: true
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml
index 3480d1ba174f..8568f729e095 100644
--- a/bin/configs/spring-boot.yaml
+++ b/bin/configs/spring-boot.yaml
@@ -3,7 +3,7 @@ outputDir: samples/server/petstore/springboot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-cloud-date-time.yaml b/bin/configs/spring-cloud-date-time.yaml
index f5797068b18a..14c7e3361f31 100644
--- a/bin/configs/spring-cloud-date-time.yaml
+++ b/bin/configs/spring-cloud-date-time.yaml
@@ -4,7 +4,7 @@ outputDir: samples/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
diff --git a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml
index 9b86ed155ed0..dc342f51ad8e 100644
--- a/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml
+++ b/bin/configs/spring-cloud-petstore-feign-without-url-param.yaml
@@ -4,7 +4,7 @@ library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"
useFeignClientUrl: "false"
diff --git a/bin/configs/spring-cloud-tags.yaml b/bin/configs/spring-cloud-tags.yaml
index afe80a6922ae..8fad04c73760 100644
--- a/bin/configs/spring-cloud-tags.yaml
+++ b/bin/configs/spring-cloud-tags.yaml
@@ -4,10 +4,10 @@ outputDir: samples/client/petstore/spring-cloud-tags
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-tags.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
useTags: "false"
- apiNameSuffix: "Controller"
\ No newline at end of file
+ apiNameSuffix: "Controller"
diff --git a/bin/configs/spring-cloud.yaml b/bin/configs/spring-cloud.yaml
index cd207cd64cd6..b4a75a6391f5 100644
--- a/bin/configs/spring-cloud.yaml
+++ b/bin/configs/spring-cloud.yaml
@@ -4,6 +4,6 @@ library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ #documentationProvider: springdoc
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml
index 30770ab3986a..45e0bb23a371 100644
--- a/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml
+++ b/bin/configs/spring-http-interface-reactive-noResponseEntity.yaml
@@ -9,7 +9,7 @@ additionalProperties:
hideGenerationTimestamp: "true"
reactive: "true"
# documentation provider should be ignored
- documentationProvider: "springfox"
+ documentationProvider: "springdoc"
# annotation provider should be ignored
annotationLibrary: "swagger1"
# validation should be ignored
diff --git a/bin/configs/spring-http-interface-reactive.yaml b/bin/configs/spring-http-interface-reactive.yaml
index 7ed2f7a640de..dd94f1f71f6f 100644
--- a/bin/configs/spring-http-interface-reactive.yaml
+++ b/bin/configs/spring-http-interface-reactive.yaml
@@ -9,7 +9,7 @@ additionalProperties:
hideGenerationTimestamp: "true"
reactive: "true"
# documentation provider should be ignored
- documentationProvider: "springfox"
+ documentationProvider: "springdoc"
# annotation provider should be ignored
annotationLibrary: "swagger1"
# validation should be ignored
diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml
index 7716066d45ec..056714c4f230 100644
--- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml
+++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern-without-j8.yaml
@@ -6,6 +6,6 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
delegatePattern: true
java8: false
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot-spring-pageable-delegatePattern-without-j8
hideGenerationTimestamp: 'true'
diff --git a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml
index 4060de18878f..980dab683b8f 100644
--- a/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml
+++ b/bin/configs/springboot-petstore-server-spring-pageable-delegatePattern.yaml
@@ -5,7 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
delegatePattern: true
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot-spring-pageable-delegatePattern
hideGenerationTimestamp: 'true'
implicitHeadersRegex: ^Version.*
diff --git a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml
index bbfb4e853129..4d7feb4fadc3 100644
--- a/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml
+++ b/bin/configs/springboot-petstore-server-spring-pageable-without-j8.yaml
@@ -5,6 +5,6 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
java8: false
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot-spring-pageable-withoutj8
hideGenerationTimestamp: 'true'
diff --git a/bin/configs/springboot-petstore-server-spring-pageable.yaml b/bin/configs/springboot-petstore-server-spring-pageable.yaml
index 5ba082602992..85dadcac577c 100644
--- a/bin/configs/springboot-petstore-server-spring-pageable.yaml
+++ b/bin/configs/springboot-petstore-server-spring-pageable.yaml
@@ -4,7 +4,7 @@ library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
- documentationProvider: springfox
+ documentationProvider: springdoc
artifactId: springboot-spring-pageable
hideGenerationTimestamp: 'true'
implicitHeadersRegex: ^Version.*
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index d1c66c436a9b..776147a26f84 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -55,7 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
-|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
+|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 4de7ab3ec038..f3090c412539 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -48,7 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
-|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
+|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumPropertyNaming|Naming convention for enum properties: 'MACRO_CASE', 'legacy' and 'original'| |MACRO_CASE|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
index ff5699f8bc71..a7a042031857 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@@ -365,7 +365,6 @@ public List supportedDocumentationProvider() {
List supportedProviders = new ArrayList<>();
supportedProviders.add(DocumentationProvider.NONE);
supportedProviders.add(DocumentationProvider.SOURCE);
- supportedProviders.add(DocumentationProvider.SPRINGFOX);
supportedProviders.add(DocumentationProvider.SPRINGDOC);
return supportedProviders;
}
@@ -386,7 +385,7 @@ public List supportedAnnotationLibraries() {
* @return true if the selected DocumentationProvider requires us to bootstrap swagger-ui.
*/
private boolean selectedDocumentationProviderRequiresSwaggerUiBootstrap() {
- return getDocumentationProvider().equals(DocumentationProvider.SPRINGFOX) || getDocumentationProvider().equals(DocumentationProvider.SOURCE);
+ return getDocumentationProvider().equals(DocumentationProvider.SOURCE);
}
@Override
@@ -447,10 +446,6 @@ public void processOpts() {
+ "useJakartaEe defaulted to 'true'");
}
- if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
- LOGGER.warn("The springfox documentation provider is deprecated for removal. Use the springdoc provider instead.");
- }
-
// clear model and api doc template as this codegen
// does not support auto-generated markdown doc at the moment
// TODO: add doc templates
@@ -529,9 +524,6 @@ public void processOpts() {
throw new IllegalArgumentException("Choose between Spring Boot 3 and Spring Boot 4");
}
if (isUseSpringBoot3() || isUseSpringBoot4()) {
- if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
- throw new IllegalArgumentException(DocumentationProvider.SPRINGFOX.getPropertyName() + " is not supported with Spring Boot > 3.x");
- }
if (AnnotationLibrary.SWAGGER1.equals(getAnnotationLibrary())) {
throw new IllegalArgumentException(AnnotationLibrary.SWAGGER1.getPropertyName() + " is not supported with Spring Boot > 3.x");
}
@@ -562,7 +554,6 @@ public void processOpts() {
importMapping.put("Nullable", "org.springframework.lang.Nullable");
importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource");
importMapping.put("DateTimeFormat", "org.springframework.format.annotation.DateTimeFormat");
- importMapping.put("ApiIgnore", "springfox.documentation.annotations.ApiIgnore");
importMapping.put("ParameterObject", "org.springdoc.api.annotations.ParameterObject");
if (isUseSpringBoot3() || isUseSpringBoot4()) {
importMapping.put("ParameterObject", "org.springdoc.core.annotations.ParameterObject");
@@ -637,10 +628,6 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("springdocDocumentationConfig.mustache",
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
"SpringDocConfiguration.java"));
- } else if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
- supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "SpringFoxConfiguration.java"));
}
}
} else if (SPRING_HTTP_INTERFACE.equals(library)) {
@@ -1140,9 +1127,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
// add org.springframework.data.domain.Pageable import when needed
if (codegenOperation.vendorExtensions.containsKey("x-spring-paginated")) {
codegenOperation.imports.add("Pageable");
- if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
- codegenOperation.imports.add("ApiIgnore");
- }
if (DocumentationProvider.SPRINGDOC.equals(getDocumentationProvider())) {
codegenOperation.imports.add("ParameterObject");
}
@@ -1162,9 +1146,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation
addSpringNullableImportForOperation(codegenOperation);
- if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider()) && includeHttpRequestContext != null && includeHttpRequestContext) {
- codegenOperation.imports.add("ApiIgnore");
- }
if (reactive && sse) {
var MEDIA_EVENT_STREAM = "text/event-stream";
// inspecting used streaming media types
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 19de71e41105..2951fd4bbc20 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
@@ -681,7 +681,6 @@ public void testMultipartBoot() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
codegen.setLibrary("spring-boot");
codegen.setDelegatePattern(true);
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml");
@@ -695,7 +694,7 @@ public void testMultipartBoot() throws IOException {
.assertMethod("multipartArray", "List")
.assertParameter("files").hasType("List")
.assertParameterAnnotations()
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"files\"", "description", "\"Many files\""))
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false"));
// UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
@@ -710,7 +709,7 @@ public void testMultipartBoot() throws IOException {
.assertMethod("multipartSingle", "MultipartFile")
.assertParameter("file").hasType("MultipartFile")
.assertParameterAnnotations()
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"file\"", "description", "\"One file\""))
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false"));
// Check that api validates mixed multipart request
@@ -719,7 +718,7 @@ public void testMultipartBoot() throws IOException {
.assertParameter("status").hasType("MultipartMixedStatus")
.assertParameterAnnotations()
.containsWithName("Valid")
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"status\"", "description", "\"\"", "required", "true"))
.containsWithNameAndAttributes("RequestParam", ImmutableMap.of("value", "\"status\"", "required", "true"))
.toParameter().toMethod()
.assertParameter("file").hasType("MultipartFile")
@@ -761,19 +760,19 @@ public void testSpringBootReactiveDefaultsToIncludeHttpRequestContextTrue() thro
codegen.setReactive(true);
codegen.setLibrary("spring-boot");
codegen.setUseSpringBoot3(false);
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
JavaFileAssert.assertThat(files.get("UserApi.java"))
.assertMethod("createUser", "Mono", "ServerWebExchange")
.assertParameter("exchange").hasType("ServerWebExchange")
.assertParameterAnnotations()
- .containsWithName("ApiIgnore")
- .doesNotContainWithName("Parameter");
+ .containsWithName("Parameter");
JavaFileAssert.assertThat(files.get("UserApi.java"))
- .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest")
- .hasImports("org.springframework.web.server.ServerWebExchange", "springfox.documentation.annotations.ApiIgnore");
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest",
+ "springfox.documentation.annotations.ApiIgnore",
+ "javax.servlet.http.HttpServletRequest")
+ .hasImports("org.springframework.web.server.ServerWebExchange");
}
@@ -802,7 +801,6 @@ public void testSpringBootReactiveIncludeHttpRequestContextFalse() throws IOExce
codegen.setReactive(true);
codegen.setLibrary("spring-boot");
codegen.setUseSpringBoot3(false);
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "false");
final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
@@ -813,7 +811,10 @@ public void testSpringBootReactiveIncludeHttpRequestContextFalse() throws IOExce
.hasNoMethod("createUser", "Mono", "ServerWebExchange");
JavaFileAssert.assertThat(files.get("UserApi.java"))
- .hasNoImports("jakarta.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange", "springfox.documentation.annotations.ApiIgnore");
+ .hasNoImports("jakarta.servlet.http.HttpServletRequest",
+ "javax.servlet.http.HttpServletRequest",
+ "org.springframework.web.server.ServerWebExchange",
+ "springfox.documentation.annotations.ApiIgnore");
}
@Test
@@ -866,7 +867,6 @@ public void testSpringBootBlockingIncludeHttpRequestContextTrue() throws IOExcep
codegen.setReactive(false);
codegen.setLibrary("spring-boot");
codegen.setUseSpringBoot3(false);
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
codegen.additionalProperties().put(INCLUDE_HTTP_REQUEST_CONTEXT, "true");
final Map files = generateFiles(codegen, "src/test/resources/3_0/petstore.yaml");
@@ -874,15 +874,16 @@ public void testSpringBootBlockingIncludeHttpRequestContextTrue() throws IOExcep
.hasNoMethod("createUser", "User");
JavaFileAssert.assertThat(files.get("UserApi.java"))
- .hasImports("javax.servlet.http.HttpServletRequest", "springfox.documentation.annotations.ApiIgnore")
- .hasNoImports("jakarta.servlet.http.HttpServletRequest", "org.springframework.web.server.ServerWebExchange");
+ .hasImports("javax.servlet.http.HttpServletRequest")
+ .hasNoImports("springfox.documentation.annotations.ApiIgnore",
+ "jakarta.servlet.http.HttpServletRequest",
+ "org.springframework.web.server.ServerWebExchange");
JavaFileAssert.assertThat(files.get("UserApi.java"))
.assertMethod("createUser", "User", "HttpServletRequest")
.assertParameter("servletRequest").hasType("HttpServletRequest")
.assertParameterAnnotations()
- .containsWithName("ApiIgnore")
- .doesNotContainWithName("Parameter");
+ .containsWithName("Parameter");
}
@@ -891,7 +892,6 @@ public void testReactiveMultipartBoot() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
codegen.setLibrary("spring-boot");
codegen.setDelegatePattern(true);
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true");
final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml");
@@ -906,7 +906,7 @@ public void testReactiveMultipartBoot() throws IOException {
.assertMethod("multipartArray", "Flux", "ServerWebExchange")
.assertParameter("files").hasType("Flux")
.assertParameterAnnotations()
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"files\"", "description", "\"Many files\""))
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false"));
// UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/
@@ -921,7 +921,7 @@ public void testReactiveMultipartBoot() throws IOException {
.assertMethod("multipartSingle", "Part", "ServerWebExchange")
.assertParameter("file").hasType("Part")
.assertParameterAnnotations()
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"file\"", "description", "\"One file\""))
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false"));
// Check that api validates mixed multipart request
@@ -930,7 +930,7 @@ public void testReactiveMultipartBoot() throws IOException {
.assertParameter("status").hasType("MultipartMixedStatus")
.assertParameterAnnotations()
.containsWithName("Valid")
- .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\""))
+ .containsWithNameAndAttributes("Parameter", ImmutableMap.of("name", "\"status\"", "description", "\"\""))
.containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true"))
.toParameter().toMethod()
.assertParameter("file").hasType("Part")
@@ -1785,7 +1785,6 @@ public void doGeneratePathVariableForSimpleParam() throws IOException {
SpringCodegen codegen = new SpringCodegen();
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");
- codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
ClientOptInput input = new ClientOptInput();
input.openAPI(openAPI);
@@ -1800,13 +1799,13 @@ public void doGeneratePathVariableForSimpleParam() throws IOException {
generator.opts(input).generate();
JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/ZebrasApi.java"))
- .fileContains("allowableValues = \"0, 1\"", "@PathVariable");
+ .fileContains("@PathVariable(\"status\")");
JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/BearsApi.java"))
- .fileContains("allowableValues = \"sleeping, awake\"", "@PathVariable");
+ .fileContains("@PathVariable(\"refCondition\")");
JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/CamelsApi.java"))
- .fileContains("allowableValues = \"sleeping, awake\"", "@PathVariable");
+ .fileContains("@PathVariable(\"condition\")");
JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/api/GiraffesApi.java"))
- .fileContains("allowableValues = \"0, 1\"", "@PathVariable");
+ .fileContains("@PathVariable(\"refStatus\")");
}
@Test
@@ -1844,22 +1843,10 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti
/**
* Define documentation providers to test
*/
- private final static String SPRINGFOX = "springfox";
- private final static String SPRINGFOX_DESTINATIONFILE = "SpringFoxConfiguration.java";
- private final static String SPRINGFOX_TEMPLATEFILE = "openapiDocumentationConfig.mustache";
private final static String SPRINGDOC = "springdoc";
private final static String SPRINGDOC_DESTINATIONFILE = "SpringDocConfiguration.java";
private final static String SPRINGDOC_TEMPLATEFILE = "springdocDocumentationConfig.mustache";
- /**
- * test whether OpenAPIDocumentationConfig.java is generated
- * fix issue #10287
- */
- @Test
- public void testConfigFileGeneration_springfox() {
- testConfigFileCommon(SPRINGFOX, SPRINGFOX_DESTINATIONFILE, SPRINGFOX_TEMPLATEFILE);
- }
-
/**
* test whether SpringDocDocumentationConfig.java is generated
* fix issue #12220
@@ -2164,7 +2151,6 @@ public void testImportMappings() {
codegen.processOpts();
Assert.assertEquals(codegen.importMapping().get("org.springframework.core.io.Resource"), "org.springframework.core.io.Resource");
Assert.assertEquals(codegen.importMapping().get("DateTimeFormat"), "org.springframework.format.annotation.DateTimeFormat");
- Assert.assertEquals(codegen.importMapping().get("ApiIgnore"), "springfox.documentation.annotations.ApiIgnore");
Assert.assertEquals(codegen.importMapping().get("ParameterObject"), "org.springdoc.api.annotations.ParameterObject");
}
@@ -2205,15 +2191,7 @@ public Object[][] issue11464TestCases() {
"@Operation( operationId = \"getSingleTag\", summary = \"Single Tag\", tags = { \"tag1\" }, responses = {");
assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"),
"@Operation( operationId = \"getMultipleTags\", summary = \"Multiple Tags\", tags = { \"tag1\", \"tag2\" }, responses = {");
- }},
- {DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> {
- assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"),
- "@ApiOperation( value = \"No Tag\", nickname = \"getNone\", notes = \"\", response = ");
- assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"),
- "@ApiOperation( tags = { \"tag1\" }, value = \"Single Tag\", nickname = \"getSingleTag\", notes = \"\", response = ");
- assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"),
- "@ApiOperation( tags = { \"tag1\", \"tag2\" }, value = \"Multiple Tags\", nickname = \"getMultipleTags\", notes = \"\", response = ");
- }},
+ }}
};
}
diff --git a/samples/client/petstore/spring-cloud-date-time/pom.xml b/samples/client/petstore/spring-cloud-date-time/pom.xml
index 43aad6ce703b..99453bccc3c7 100644
--- a/samples/client/petstore/spring-cloud-date-time/pom.xml
+++ b/samples/client/petstore/spring-cloud-date-time/pom.xml
@@ -10,7 +10,7 @@
${java.version}
${java.version}
UTF-8
- 2.9.2
+ 1.6.14
org.springframework.boot
@@ -49,11 +49,11 @@
-
+
- io.springfox
- springfox-swagger2
- ${springfox.version}
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java
index 34b40fb977bc..2e81ce340687 100644
--- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java
+++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java
@@ -9,7 +9,18 @@
import java.time.LocalDate;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -24,7 +35,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "Default", description = "the Default API")
+@Tag(name = "Default", description = "the Default API")
public interface DefaultApi {
String PATH_GET = "/thingy/{date}";
@@ -37,23 +48,21 @@ public interface DefaultApi {
* @param loginDate A date cookie parameter (optional, default to 1975-01-01)
* @return OK (status code 200)
*/
- @ApiOperation(
- value = "",
- nickname = "get",
- notes = ""
+ @Operation(
+ operationId = "get",
+ responses = {
+ @ApiResponse(responseCode = "200", description = "OK")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "OK")
- })
@RequestMapping(
method = RequestMethod.GET,
value = DefaultApi.PATH_GET
)
ResponseEntity get(
- @ApiParam(value = "A date path parameter", required = true, defaultValue = "1972-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
- @NotNull @ApiParam(value = "A date-time query parameter", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
- @NotNull @ApiParam(value = "A date header parameter", required = true, defaultValue = "1974-01-01") @RequestHeader(value = "X-Order-Date", required = true, defaultValue = "1974-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate,
- @ApiParam(value = "A date cookie parameter", defaultValue = "1975-01-01") @CookieValue(name = "loginDate", required = false, defaultValue = "1975-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate
+ @Parameter(name = "date", description = "A date path parameter", required = true, in = ParameterIn.PATH) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
+ @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
+ @NotNull @Parameter(name = "X-Order-Date", description = "A date header parameter", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "X-Order-Date", required = true, defaultValue = "1974-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate xOrderDate,
+ @Parameter(name = "loginDate", description = "A date cookie parameter", in = ParameterIn.COOKIE) @CookieValue(name = "loginDate", required = false, defaultValue = "1975-01-01") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate loginDate
);
@@ -66,22 +75,21 @@ ResponseEntity get(
* @param visitDate Updated last visit timestamp (optional, default to 1971-12-19T03:39:57-08:00)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
- value = "",
- nickname = "updatePetWithForm",
- notes = "update with form data"
+ @Operation(
+ operationId = "updatePetWithForm",
+ description = "update with form data",
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = DefaultApi.PATH_UPDATE_PET_WITH_FORM,
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity updatePetWithForm(
- @ApiParam(value = "A date path parameter", required = true, defaultValue = "1970-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
- @ApiParam(value = "Updated last visit timestamp", defaultValue = "1971-12-19T03:39:57-08:00") @Valid @RequestParam(value = "visitDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate
+ @Parameter(name = "date", description = "A date path parameter", required = true, in = ParameterIn.PATH) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
+ @Parameter(name = "visitDate", description = "Updated last visit timestamp") @Valid @RequestParam(value = "visitDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate
);
}
diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java
index 35f411500d3b..2d058be64a67 100644
--- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/model/Pet.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
@@ -15,6 +13,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -62,7 +61,7 @@ public Pet atType(String atType) {
* @return atType
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "@type", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("@type")
public String getAtType() {
return atType;
@@ -83,7 +82,7 @@ public Pet age(Integer age) {
* @return age
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "age", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("age")
public Integer getAge() {
return age;
@@ -104,7 +103,7 @@ public Pet happy(Boolean happy) {
* @return happy
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "happy", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("happy")
public Boolean getHappy() {
return happy;
@@ -125,7 +124,7 @@ public Pet price(BigDecimal price) {
* @return price
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "price", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("price")
public BigDecimal getPrice() {
return price;
@@ -146,7 +145,7 @@ public Pet lastFeed(OffsetDateTime lastFeed) {
* @return lastFeed
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "lastFeed", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("lastFeed")
public OffsetDateTime getLastFeed() {
return lastFeed;
@@ -167,7 +166,7 @@ public Pet dateOfBirth(LocalDate dateOfBirth) {
* @return dateOfBirth
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "dateOfBirth", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("dateOfBirth")
public LocalDate getDateOfBirth() {
return dateOfBirth;
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/pom.xml b/samples/client/petstore/spring-cloud-feign-without-url/pom.xml
index 294ae75e1f5e..3587a8c63231 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/pom.xml
+++ b/samples/client/petstore/spring-cloud-feign-without-url/pom.xml
@@ -10,7 +10,7 @@
${java.version}
${java.version}
UTF-8
- 2.9.2
+ 1.6.14
org.springframework.boot
@@ -36,11 +36,11 @@
-
+
- io.springfox
- springfox-swagger2
- ${springfox.version}
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java
index bd8739923c7f..fd08a49f576b 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java
@@ -8,7 +8,18 @@
import org.openapitools.model.ModelApiResponse;
import org.springframework.lang.Nullable;
import org.openapitools.model.Pet;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -23,7 +34,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "pet", description = "Everything about your Pets")
+@Tag(name = "pet", description = "Everything about your Pets")
public interface PetApi {
String PATH_ADD_PET = "/pet";
@@ -35,23 +46,22 @@ public interface PetApi {
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
+ description = "",
tags = { "pet" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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 = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_ADD_PET,
@@ -59,7 +69,7 @@ public interface PetApi {
consumes = "application/json"
)
ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
@@ -72,28 +82,25 @@ ResponseEntity addPet(
* @param apiKey (optional)
* @return Invalid pet value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
+ description = "",
tags = { "pet" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = PetApi.PATH_DELETE_PET
)
ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
+ @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) @Nullable String apiKey
);
@@ -106,30 +113,29 @@ ResponseEntity deletePet(
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
tags = { "pet" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_STATUS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status
+ @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status
);
@@ -144,30 +150,30 @@ ResponseEntity> findPetsByStatus(
* @deprecated
*/
@Deprecated
- @ApiOperation(
+ @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" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_TAGS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags
);
@@ -181,28 +187,30 @@ ResponseEntity> findPetsByTags(
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
tags = { "pet" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
+ 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")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_GET_PET_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
+ @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
);
@@ -219,25 +227,25 @@ ResponseEntity getPetById(
* API documentation for the updatePet operation
* @see Update an existing pet Documentation
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
+ description = "",
tags = { "pet" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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"),
+ @ApiResponse(responseCode = "405", description = "Validation exception")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ },
+ externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet")
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = PetApi.PATH_UPDATE_PET,
@@ -245,7 +253,7 @@ ResponseEntity getPetById(
consumes = "application/json"
)
ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
@@ -259,30 +267,27 @@ ResponseEntity updatePet(
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
+ description = "",
tags = { "pet" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPDATE_PET_WITH_FORM,
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
+ @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
);
@@ -296,22 +301,20 @@ ResponseEntity updatePetWithForm(
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
+ description = "",
tags = { "pet" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPLOAD_FILE,
@@ -319,9 +322,9 @@ ResponseEntity updatePetWithForm(
consumes = "multipart/form-data"
)
ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ @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-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java
index b496201aba01..a6faa8443a19 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java
@@ -7,7 +7,18 @@
import java.util.Map;
import org.openapitools.model.Order;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "store", description = "Access to Petstore orders")
+@Tag(name = "store", description = "Access to Petstore orders")
public interface StoreApi {
String PATH_DELETE_ORDER = "/store/order/{orderId}";
@@ -34,22 +45,22 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @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" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = StoreApi.PATH_DELETE_ORDER
)
ResponseEntity deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
+ @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
);
@@ -60,20 +71,20 @@ ResponseEntity deleteOrder(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
tags = { "store" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_INVENTORY,
@@ -94,25 +105,27 @@ ResponseEntity> getInventory(
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getOrderById",
+ summary = "Find purchase order by ID",
+ description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
tags = { "store" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_ORDER_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getOrderById(
- @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
+ @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
);
@@ -125,17 +138,19 @@ ResponseEntity getOrderById(
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "placeOrder",
+ summary = "Place an order for a pet",
+ description = "",
tags = { "store" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid Order")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
@RequestMapping(
method = RequestMethod.POST,
value = StoreApi.PATH_PLACE_ORDER,
@@ -143,7 +158,7 @@ ResponseEntity getOrderById(
consumes = "application/json"
)
ResponseEntity placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
+ @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
);
}
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java
index 06593b538572..f848b36eb499 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java
@@ -7,7 +7,18 @@
import java.time.OffsetDateTime;
import org.openapitools.model.User;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "user", description = "Operations about user")
+@Tag(name = "user", description = "Operations about user")
public interface UserApi {
String PATH_CREATE_USER = "/user";
@@ -33,25 +44,25 @@ public interface UserApi {
* @param user Created user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUser",
+ summary = "Create user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USER,
consumes = "application/json"
)
ResponseEntity createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user
);
@@ -63,25 +74,25 @@ ResponseEntity createUser(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithArrayInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT,
consumes = "application/json"
)
ResponseEntity createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
);
@@ -93,25 +104,25 @@ ResponseEntity createUsersWithArrayInput(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithListInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT,
consumes = "application/json"
)
ResponseEntity createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
);
@@ -124,25 +135,25 @@ ResponseEntity createUsersWithListInput(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deleteUser",
+ summary = "Delete user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = UserApi.PATH_DELETE_USER
)
ResponseEntity deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -156,25 +167,27 @@ ResponseEntity deleteUser(
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getUserByName",
+ summary = "Get user by user name",
+ description = "",
tags = { "user" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_GET_USER_BY_NAME,
produces = { "application/json", "application/xml" }
)
ResponseEntity getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -188,25 +201,27 @@ ResponseEntity getUserByName(
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "loginUser",
+ summary = "Logs user into the system",
+ description = "",
tags = { "user" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGIN_USER,
produces = { "application/json", "application/xml" }
)
ResponseEntity loginUser(
- @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
+ @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password
);
@@ -217,18 +232,18 @@ ResponseEntity loginUser(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "logoutUser",
+ summary = "Logs out current logged in user session",
+ description = "",
tags = { "user" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGOUT_USER
@@ -248,27 +263,27 @@ ResponseEntity logoutUser(
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updateUser",
+ summary = "Updated user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid user supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = UserApi.PATH_UPDATE_USER,
consumes = "application/json"
)
ResponseEntity updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
);
}
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java
index 04a37147726e..24b392308f53 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Category.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A category for a pet
*/
-@ApiModel(description = "A category for a pet")
+@Schema(name = "Category", description = "A category for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Category {
@@ -38,7 +37,7 @@ public Category id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Category name(@Nullable String name) {
* @return name
*/
@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java
index 1012a5a2bdb3..edeb1f66019e 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -5,13 +5,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -21,7 +20,7 @@
* Describes the result of uploading an image resource
*/
-@ApiModel(description = "Describes the result of uploading an image resource")
+@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource")
@JsonTypeName("ApiResponse")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class ModelApiResponse {
@@ -42,7 +41,7 @@ public ModelApiResponse code(@Nullable Integer code) {
* @return code
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("code")
public @Nullable Integer getCode() {
return code;
@@ -63,7 +62,7 @@ public ModelApiResponse type(@Nullable String type) {
* @return type
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("type")
public @Nullable String getType() {
return type;
@@ -84,7 +83,7 @@ public ModelApiResponse message(@Nullable String message) {
* @return message
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("message")
public @Nullable String getMessage() {
return message;
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java
index fefd64b7bf9c..0c245c5f9f2c 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Order.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -23,7 +22,7 @@
* An order for a pets from the pet store
*/
-@ApiModel(description = "An order for a pets from the pet store")
+@Schema(name = "Order", description = "An order for a pets from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Order {
@@ -87,7 +86,7 @@ public Order id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -108,7 +107,7 @@ public Order petId(@Nullable Long petId) {
* @return petId
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("petId")
public @Nullable Long getPetId() {
return petId;
@@ -129,7 +128,7 @@ public Order quantity(@Nullable Integer quantity) {
* @return quantity
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("quantity")
public @Nullable Integer getQuantity() {
return quantity;
@@ -150,7 +149,7 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) {
* @return shipDate
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("shipDate")
public @Nullable OffsetDateTime getShipDate() {
return shipDate;
@@ -171,7 +170,7 @@ public Order status(@Nullable StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "Order Status")
+ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
return status;
@@ -192,7 +191,7 @@ public Order complete(Boolean complete) {
* @return complete
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
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 5c87f13202bf..06067f7a0c84 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
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -17,6 +15,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -26,7 +25,7 @@
* A pet for sale in the pet store
*/
-@ApiModel(description = "A pet for sale in the pet store")
+@Schema(name = "Pet", description = "A pet for sale in the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Pet {
@@ -104,7 +103,7 @@ public Pet id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -125,7 +124,7 @@ public Pet category(@Nullable Category category) {
* @return category
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("category")
public @Nullable Category getCategory() {
return category;
@@ -146,7 +145,7 @@ public Pet name(String name) {
* @return name
*/
@NotNull
- @ApiModelProperty(example = "doggie", required = true, value = "")
+ @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("name")
public String getName() {
return name;
@@ -175,7 +174,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* @return photoUrls
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("photoUrls")
public List getPhotoUrls() {
return photoUrls;
@@ -204,7 +203,7 @@ public Pet addTagsItem(Tag tagsItem) {
* @return tags
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("tags")
public List<@Valid Tag> getTags() {
return tags;
@@ -226,7 +225,7 @@ public Pet status(@Nullable StatusEnum status) {
* @deprecated
*/
- @ApiModelProperty(value = "pet status in the store")
+ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@Deprecated
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java
index 34510604ee4d..1f94a8ef63aa 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Tag.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A tag for a pet
*/
-@ApiModel(description = "A tag for a pet")
+@Schema(name = "Tag", description = "A tag for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Tag {
@@ -38,7 +37,7 @@ public Tag id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Tag name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java
index c93944d5ea2e..ae9bf7482766 100644
--- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java
+++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/User.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A User who is purchasing from the pet store
*/
-@ApiModel(description = "A User who is purchasing from the pet store")
+@Schema(name = "User", description = "A User who is purchasing from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class User {
@@ -50,7 +49,7 @@ public User id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -71,7 +70,7 @@ public User username(@Nullable String username) {
* @return username
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("username")
public @Nullable String getUsername() {
return username;
@@ -92,7 +91,7 @@ public User firstName(@Nullable String firstName) {
* @return firstName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("firstName")
public @Nullable String getFirstName() {
return firstName;
@@ -113,7 +112,7 @@ public User lastName(@Nullable String lastName) {
* @return lastName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("lastName")
public @Nullable String getLastName() {
return lastName;
@@ -134,7 +133,7 @@ public User email(@Nullable String email) {
* @return email
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("email")
public @Nullable String getEmail() {
return email;
@@ -155,7 +154,7 @@ public User password(@Nullable String password) {
* @return password
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("password")
public @Nullable String getPassword() {
return password;
@@ -176,7 +175,7 @@ public User phone(@Nullable String phone) {
* @return phone
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("phone")
public @Nullable String getPhone() {
return phone;
@@ -197,7 +196,7 @@ public User userStatus(@Nullable Integer userStatus) {
* @return userStatus
*/
- @ApiModelProperty(value = "User Status")
+ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("userStatus")
public @Nullable Integer getUserStatus() {
return userStatus;
diff --git a/samples/client/petstore/spring-cloud-tags/pom.xml b/samples/client/petstore/spring-cloud-tags/pom.xml
index 2f7b1fc778e9..4ff9ae4a11d6 100644
--- a/samples/client/petstore/spring-cloud-tags/pom.xml
+++ b/samples/client/petstore/spring-cloud-tags/pom.xml
@@ -10,7 +10,7 @@
${java.version}
${java.version}
UTF-8
- 2.9.2
+ 1.6.14
org.springframework.boot
@@ -49,11 +49,11 @@
-
+
- io.springfox
- springfox-swagger2
- ${springfox.version}
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java
index 5c9101695454..97873cc05613 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java
@@ -5,12 +5,23 @@
*/
package org.openapitools.api;
-import springfox.documentation.annotations.ApiIgnore;
import org.openapitools.model.ModelApiResponse;
import org.springframework.lang.Nullable;
import org.springframework.data.domain.Pageable;
+import org.springdoc.api.annotations.ParameterObject;
import org.openapitools.model.Pet;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -25,7 +36,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "pet tag", description = "the pet tag API")
+@Tag(name = "pet tag", description = "the pet tag API")
public interface PetController {
String PATH_ADD_PET = "/pet";
@@ -35,28 +46,24 @@ public interface PetController {
* @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
tags = { "pet tag" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetController.PATH_ADD_PET,
consumes = "application/json"
)
ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
+ @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
);
@@ -68,28 +75,24 @@ ResponseEntity addPet(
* @param apiKey (optional)
* @return Invalid pet value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
tags = { "pet tag" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = PetController.PATH_DELETE_PET
)
ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
+ @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) @Nullable String apiKey
);
@@ -102,32 +105,30 @@ ResponseEntity deletePet(
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
tags = { "pet tag" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetController.PATH_FIND_PETS_BY_STATUS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status,
- @ApiIgnore final Pageable pageable
+ @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,
+ @ParameterObject final Pageable pageable
);
@@ -142,32 +143,31 @@ ResponseEntity> findPetsByStatus(
* @deprecated
*/
@Deprecated
- @ApiOperation(
+ @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 tag" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetController.PATH_FIND_PETS_BY_TAGS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags,
- @ApiIgnore final Pageable pageable
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags,
+ @ParameterObject final Pageable pageable
);
@@ -181,28 +181,30 @@ ResponseEntity> findPetsByTags(
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
tags = { "pet tag" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
+ 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")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetController.PATH_GET_PET_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
+ @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
);
@@ -215,30 +217,26 @@ ResponseEntity getPetById(
* or Pet not found (status code 404)
* or Validation exception (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
tags = { "pet tag" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = PetController.PATH_UPDATE_PET,
consumes = "application/json"
)
ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
+ @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
);
@@ -251,30 +249,26 @@ ResponseEntity updatePet(
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
tags = { "pet tag" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetController.PATH_UPDATE_PET_WITH_FORM,
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
+ @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
);
@@ -287,22 +281,19 @@ ResponseEntity updatePetWithForm(
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
tags = { "pet tag" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetController.PATH_UPLOAD_FILE,
@@ -310,9 +301,9 @@ ResponseEntity updatePetWithForm(
consumes = "multipart/form-data"
)
ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ @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-tags/src/main/java/org/openapitools/api/StoreController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java
index b19b029bb087..1b1b8a5c9462 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java
@@ -7,7 +7,18 @@
import java.util.Map;
import org.openapitools.model.Order;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "store tag", description = "the store tag API")
+@Tag(name = "store tag", description = "the store tag API")
public interface StoreController {
String PATH_DELETE_ORDER = "/store/order/{orderId}";
@@ -34,22 +45,22 @@ public interface StoreController {
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @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 tag" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = StoreController.PATH_DELETE_ORDER
)
ResponseEntity deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
+ @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
);
@@ -60,20 +71,20 @@ ResponseEntity deleteOrder(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
tags = { "store tag" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreController.PATH_GET_INVENTORY,
@@ -94,25 +105,27 @@ ResponseEntity> getInventory(
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getOrderById",
+ summary = "Find purchase order by ID",
+ description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
tags = { "store tag" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreController.PATH_GET_ORDER_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getOrderById(
- @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
+ @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
);
@@ -124,24 +137,25 @@ ResponseEntity getOrderById(
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "placeOrder",
+ summary = "Place an order for a pet",
tags = { "store tag" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid Order")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
@RequestMapping(
method = RequestMethod.POST,
value = StoreController.PATH_PLACE_ORDER,
produces = { "application/json", "application/xml" }
)
ResponseEntity placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
+ @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
);
}
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java
index 0c07bfdea4ca..862aa93b422c 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java
@@ -7,7 +7,18 @@
import java.time.OffsetDateTime;
import org.openapitools.model.User;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "user tag", description = "the user tag API")
+@Tag(name = "user tag", description = "the user tag API")
public interface UserController {
String PATH_CREATE_USER = "/user";
@@ -33,21 +44,21 @@ public interface UserController {
* @param body Created user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUser",
+ summary = "Create user",
+ description = "This can only be done by the logged in user.",
tags = { "user tag" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserController.PATH_CREATE_USER
)
ResponseEntity createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
+ @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body
);
@@ -58,21 +69,20 @@ ResponseEntity createUser(
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithArrayInput",
+ summary = "Creates list of users with given input array",
tags = { "user tag" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserController.PATH_CREATE_USERS_WITH_ARRAY_INPUT
)
ResponseEntity createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body
+ @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body
);
@@ -83,21 +93,20 @@ ResponseEntity createUsersWithArrayInput(
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithListInput",
+ summary = "Creates list of users with given input array",
tags = { "user tag" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserController.PATH_CREATE_USERS_WITH_LIST_INPUT
)
ResponseEntity createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body
+ @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body
);
@@ -110,22 +119,22 @@ ResponseEntity createUsersWithListInput(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deleteUser",
+ summary = "Delete user",
+ description = "This can only be done by the logged in user.",
tags = { "user tag" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = UserController.PATH_DELETE_USER
)
ResponseEntity deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -138,25 +147,26 @@ ResponseEntity deleteUser(
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getUserByName",
+ summary = "Get user by user name",
tags = { "user tag" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserController.PATH_GET_USER_BY_NAME,
produces = { "application/json", "application/xml" }
)
ResponseEntity getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -169,25 +179,26 @@ ResponseEntity getUserByName(
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "loginUser",
+ summary = "Logs user into the system",
tags = { "user tag" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserController.PATH_LOGIN_USER,
produces = { "application/json", "application/xml" }
)
ResponseEntity loginUser(
- @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
+ @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password
);
@@ -197,15 +208,14 @@ ResponseEntity loginUser(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "logoutUser",
+ summary = "Logs out current logged in user session",
tags = { "user tag" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserController.PATH_LOGOUT_USER
@@ -221,15 +231,14 @@ ResponseEntity logoutUser(
*
* @return endpoint configuration response (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "logoutUserOptions",
+ summary = "logoutUserOptions",
tags = { "user tag" },
- value = "logoutUserOptions",
- nickname = "logoutUserOptions",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "endpoint configuration response")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "endpoint configuration response")
- })
@RequestMapping(
method = RequestMethod.OPTIONS,
value = UserController.PATH_LOGOUT_USER_OPTIONS
@@ -249,23 +258,23 @@ ResponseEntity logoutUserOptions(
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updateUser",
+ summary = "Updated user",
+ description = "This can only be done by the logged in user.",
tags = { "user tag" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid user supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = UserController.PATH_UPDATE_USER
)
ResponseEntity updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
+ @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body
);
}
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java
index 8959a86fd679..ab58c7833530 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Category.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A category for a pet
*/
-@ApiModel(description = "A category for a pet")
+@Schema(name = "Category", description = "A category for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Category {
@@ -38,7 +37,7 @@ public Category id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Category name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java
index 1012a5a2bdb3..edeb1f66019e 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -5,13 +5,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -21,7 +20,7 @@
* Describes the result of uploading an image resource
*/
-@ApiModel(description = "Describes the result of uploading an image resource")
+@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource")
@JsonTypeName("ApiResponse")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class ModelApiResponse {
@@ -42,7 +41,7 @@ public ModelApiResponse code(@Nullable Integer code) {
* @return code
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("code")
public @Nullable Integer getCode() {
return code;
@@ -63,7 +62,7 @@ public ModelApiResponse type(@Nullable String type) {
* @return type
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("type")
public @Nullable String getType() {
return type;
@@ -84,7 +83,7 @@ public ModelApiResponse message(@Nullable String message) {
* @return message
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("message")
public @Nullable String getMessage() {
return message;
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java
index fefd64b7bf9c..0c245c5f9f2c 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Order.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -23,7 +22,7 @@
* An order for a pets from the pet store
*/
-@ApiModel(description = "An order for a pets from the pet store")
+@Schema(name = "Order", description = "An order for a pets from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Order {
@@ -87,7 +86,7 @@ public Order id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -108,7 +107,7 @@ public Order petId(@Nullable Long petId) {
* @return petId
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("petId")
public @Nullable Long getPetId() {
return petId;
@@ -129,7 +128,7 @@ public Order quantity(@Nullable Integer quantity) {
* @return quantity
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("quantity")
public @Nullable Integer getQuantity() {
return quantity;
@@ -150,7 +149,7 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) {
* @return shipDate
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("shipDate")
public @Nullable OffsetDateTime getShipDate() {
return shipDate;
@@ -171,7 +170,7 @@ public Order status(@Nullable StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "Order Status")
+ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
return status;
@@ -192,7 +191,7 @@ public Order complete(Boolean complete) {
* @return complete
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java
index 16bb5cc9d495..f28d8ab37276 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Pet.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -17,6 +15,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -26,7 +25,7 @@
* A pet for sale in the pet store
*/
-@ApiModel(description = "A pet for sale in the pet store")
+@Schema(name = "Pet", description = "A pet for sale in the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Pet {
@@ -103,7 +102,7 @@ public Pet id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -124,7 +123,7 @@ public Pet category(@Nullable Category category) {
* @return category
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("category")
public @Nullable Category getCategory() {
return category;
@@ -145,7 +144,7 @@ public Pet name(String name) {
* @return name
*/
@NotNull
- @ApiModelProperty(example = "doggie", required = true, value = "")
+ @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("name")
public String getName() {
return name;
@@ -174,7 +173,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* @return photoUrls
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("photoUrls")
public List getPhotoUrls() {
return photoUrls;
@@ -203,7 +202,7 @@ public Pet addTagsItem(Tag tagsItem) {
* @return tags
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("tags")
public List<@Valid Tag> getTags() {
return tags;
@@ -224,7 +223,7 @@ public Pet status(@Nullable StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "pet status in the store")
+ @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
return status;
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java
index 34510604ee4d..1f94a8ef63aa 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/Tag.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A tag for a pet
*/
-@ApiModel(description = "A tag for a pet")
+@Schema(name = "Tag", description = "A tag for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Tag {
@@ -38,7 +37,7 @@ public Tag id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Tag name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java
index c93944d5ea2e..ae9bf7482766 100644
--- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java
+++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/model/User.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A User who is purchasing from the pet store
*/
-@ApiModel(description = "A User who is purchasing from the pet store")
+@Schema(name = "User", description = "A User who is purchasing from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class User {
@@ -50,7 +49,7 @@ public User id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -71,7 +70,7 @@ public User username(@Nullable String username) {
* @return username
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("username")
public @Nullable String getUsername() {
return username;
@@ -92,7 +91,7 @@ public User firstName(@Nullable String firstName) {
* @return firstName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("firstName")
public @Nullable String getFirstName() {
return firstName;
@@ -113,7 +112,7 @@ public User lastName(@Nullable String lastName) {
* @return lastName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("lastName")
public @Nullable String getLastName() {
return lastName;
@@ -134,7 +133,7 @@ public User email(@Nullable String email) {
* @return email
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("email")
public @Nullable String getEmail() {
return email;
@@ -155,7 +154,7 @@ public User password(@Nullable String password) {
* @return password
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("password")
public @Nullable String getPassword() {
return password;
@@ -176,7 +175,7 @@ public User phone(@Nullable String phone) {
* @return phone
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("phone")
public @Nullable String getPhone() {
return phone;
@@ -197,7 +196,7 @@ public User userStatus(@Nullable Integer userStatus) {
* @return userStatus
*/
- @ApiModelProperty(value = "User Status")
+ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("userStatus")
public @Nullable Integer getUserStatus() {
return userStatus;
diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml
index 294ae75e1f5e..3587a8c63231 100644
--- a/samples/client/petstore/spring-cloud/pom.xml
+++ b/samples/client/petstore/spring-cloud/pom.xml
@@ -10,7 +10,7 @@
${java.version}
${java.version}
UTF-8
- 2.9.2
+ 1.6.14
org.springframework.boot
@@ -36,11 +36,11 @@
-
+
- io.springfox
- springfox-swagger2
- ${springfox.version}
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java
index bd8739923c7f..fd08a49f576b 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java
@@ -8,7 +8,18 @@
import org.openapitools.model.ModelApiResponse;
import org.springframework.lang.Nullable;
import org.openapitools.model.Pet;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -23,7 +34,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "pet", description = "Everything about your Pets")
+@Tag(name = "pet", description = "Everything about your Pets")
public interface PetApi {
String PATH_ADD_PET = "/pet";
@@ -35,23 +46,22 @@ public interface PetApi {
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
+ description = "",
tags = { "pet" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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 = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_ADD_PET,
@@ -59,7 +69,7 @@ public interface PetApi {
consumes = "application/json"
)
ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
@@ -72,28 +82,25 @@ ResponseEntity addPet(
* @param apiKey (optional)
* @return Invalid pet value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
+ description = "",
tags = { "pet" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = PetApi.PATH_DELETE_PET
)
ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
+ @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) @Nullable String apiKey
);
@@ -106,30 +113,29 @@ ResponseEntity deletePet(
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
tags = { "pet" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_STATUS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status
+ @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status
);
@@ -144,30 +150,30 @@ ResponseEntity> findPetsByStatus(
* @deprecated
*/
@Deprecated
- @ApiOperation(
+ @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" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_TAGS,
produces = { "application/json", "application/xml" }
)
ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags
);
@@ -181,28 +187,30 @@ ResponseEntity> findPetsByTags(
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
tags = { "pet" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
+ 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")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_GET_PET_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
+ @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
);
@@ -219,25 +227,25 @@ ResponseEntity getPetById(
* API documentation for the updatePet operation
* @see Update an existing pet Documentation
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
+ description = "",
tags = { "pet" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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"),
+ @ApiResponse(responseCode = "405", description = "Validation exception")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ },
+ externalDocs = @ExternalDocumentation(description = "API documentation for the updatePet operation", url = "http://petstore.swagger.io/v2/doc/updatePet")
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = PetApi.PATH_UPDATE_PET,
@@ -245,7 +253,7 @@ ResponseEntity getPetById(
consumes = "application/json"
)
ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
@@ -259,30 +267,27 @@ ResponseEntity updatePet(
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
+ description = "",
tags = { "pet" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPDATE_PET_WITH_FORM,
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
+ @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
);
@@ -296,22 +301,20 @@ ResponseEntity updatePetWithForm(
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
+ description = "",
tags = { "pet" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPLOAD_FILE,
@@ -319,9 +322,9 @@ ResponseEntity updatePetWithForm(
consumes = "multipart/form-data"
)
ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ @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/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java
index b496201aba01..a6faa8443a19 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java
@@ -7,7 +7,18 @@
import java.util.Map;
import org.openapitools.model.Order;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "store", description = "Access to Petstore orders")
+@Tag(name = "store", description = "Access to Petstore orders")
public interface StoreApi {
String PATH_DELETE_ORDER = "/store/order/{orderId}";
@@ -34,22 +45,22 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @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" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = StoreApi.PATH_DELETE_ORDER
)
ResponseEntity deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
+ @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId
);
@@ -60,20 +71,20 @@ ResponseEntity deleteOrder(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
tags = { "store" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_INVENTORY,
@@ -94,25 +105,27 @@ ResponseEntity> getInventory(
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getOrderById",
+ summary = "Find purchase order by ID",
+ description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
tags = { "store" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_ORDER_BY_ID,
produces = { "application/json", "application/xml" }
)
ResponseEntity getOrderById(
- @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
+ @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
);
@@ -125,17 +138,19 @@ ResponseEntity getOrderById(
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "placeOrder",
+ summary = "Place an order for a pet",
+ description = "",
tags = { "store" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid Order")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
@RequestMapping(
method = RequestMethod.POST,
value = StoreApi.PATH_PLACE_ORDER,
@@ -143,7 +158,7 @@ ResponseEntity getOrderById(
consumes = "application/json"
)
ResponseEntity placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
+ @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
);
}
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java
index 06593b538572..f848b36eb499 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java
@@ -7,7 +7,18 @@
import java.time.OffsetDateTime;
import org.openapitools.model.User;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -22,7 +33,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "user", description = "Operations about user")
+@Tag(name = "user", description = "Operations about user")
public interface UserApi {
String PATH_CREATE_USER = "/user";
@@ -33,25 +44,25 @@ public interface UserApi {
* @param user Created user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUser",
+ summary = "Create user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USER,
consumes = "application/json"
)
ResponseEntity createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user
);
@@ -63,25 +74,25 @@ ResponseEntity createUser(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithArrayInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT,
consumes = "application/json"
)
ResponseEntity createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
);
@@ -93,25 +104,25 @@ ResponseEntity createUsersWithArrayInput(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithListInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT,
consumes = "application/json"
)
ResponseEntity createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
);
@@ -124,25 +135,25 @@ ResponseEntity createUsersWithListInput(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deleteUser",
+ summary = "Delete user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = UserApi.PATH_DELETE_USER
)
ResponseEntity deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -156,25 +167,27 @@ ResponseEntity deleteUser(
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getUserByName",
+ summary = "Get user by user name",
+ description = "",
tags = { "user" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_GET_USER_BY_NAME,
produces = { "application/json", "application/xml" }
)
ResponseEntity getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
);
@@ -188,25 +201,27 @@ ResponseEntity getUserByName(
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "loginUser",
+ summary = "Logs user into the system",
+ description = "",
tags = { "user" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGIN_USER,
produces = { "application/json", "application/xml" }
)
ResponseEntity loginUser(
- @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
+ @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password
);
@@ -217,18 +232,18 @@ ResponseEntity loginUser(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "logoutUser",
+ summary = "Logs out current logged in user session",
+ description = "",
tags = { "user" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = "",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGOUT_USER
@@ -248,27 +263,27 @@ ResponseEntity logoutUser(
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updateUser",
+ summary = "Updated user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user.",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid user supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = UserApi.PATH_UPDATE_USER,
consumes = "application/json"
)
ResponseEntity updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
);
}
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java
index 04a37147726e..24b392308f53 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Category.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A category for a pet
*/
-@ApiModel(description = "A category for a pet")
+@Schema(name = "Category", description = "A category for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Category {
@@ -38,7 +37,7 @@ public Category id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Category name(@Nullable String name) {
* @return name
*/
@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java
index 1012a5a2bdb3..edeb1f66019e 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -5,13 +5,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -21,7 +20,7 @@
* Describes the result of uploading an image resource
*/
-@ApiModel(description = "Describes the result of uploading an image resource")
+@Schema(name = "ApiResponse", description = "Describes the result of uploading an image resource")
@JsonTypeName("ApiResponse")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class ModelApiResponse {
@@ -42,7 +41,7 @@ public ModelApiResponse code(@Nullable Integer code) {
* @return code
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("code")
public @Nullable Integer getCode() {
return code;
@@ -63,7 +62,7 @@ public ModelApiResponse type(@Nullable String type) {
* @return type
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("type")
public @Nullable String getType() {
return type;
@@ -84,7 +83,7 @@ public ModelApiResponse message(@Nullable String message) {
* @return message
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("message")
public @Nullable String getMessage() {
return message;
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java
index fefd64b7bf9c..0c245c5f9f2c 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Order.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -23,7 +22,7 @@
* An order for a pets from the pet store
*/
-@ApiModel(description = "An order for a pets from the pet store")
+@Schema(name = "Order", description = "An order for a pets from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Order {
@@ -87,7 +86,7 @@ public Order id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -108,7 +107,7 @@ public Order petId(@Nullable Long petId) {
* @return petId
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("petId")
public @Nullable Long getPetId() {
return petId;
@@ -129,7 +128,7 @@ public Order quantity(@Nullable Integer quantity) {
* @return quantity
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("quantity")
public @Nullable Integer getQuantity() {
return quantity;
@@ -150,7 +149,7 @@ public Order shipDate(@Nullable OffsetDateTime shipDate) {
* @return shipDate
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("shipDate")
public @Nullable OffsetDateTime getShipDate() {
return shipDate;
@@ -171,7 +170,7 @@ public Order status(@Nullable StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "Order Status")
+ @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
return status;
@@ -192,7 +191,7 @@ public Order complete(Boolean complete) {
* @return complete
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("complete")
public Boolean getComplete() {
return complete;
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 5c87f13202bf..06067f7a0c84 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
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -17,6 +15,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -26,7 +25,7 @@
* A pet for sale in the pet store
*/
-@ApiModel(description = "A pet for sale in the pet store")
+@Schema(name = "Pet", description = "A pet for sale in the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Pet {
@@ -104,7 +103,7 @@ public Pet id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -125,7 +124,7 @@ public Pet category(@Nullable Category category) {
* @return category
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("category")
public @Nullable Category getCategory() {
return category;
@@ -146,7 +145,7 @@ public Pet name(String name) {
* @return name
*/
@NotNull
- @ApiModelProperty(example = "doggie", required = true, value = "")
+ @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("name")
public String getName() {
return name;
@@ -175,7 +174,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* @return photoUrls
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("photoUrls")
public List getPhotoUrls() {
return photoUrls;
@@ -204,7 +203,7 @@ public Pet addTagsItem(Tag tagsItem) {
* @return tags
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("tags")
public List<@Valid Tag> getTags() {
return tags;
@@ -226,7 +225,7 @@ public Pet status(@Nullable StatusEnum status) {
* @deprecated
*/
- @ApiModelProperty(value = "pet status in the store")
+ @Schema(name = "status", description = "pet status in the store", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@Deprecated
@JsonProperty("status")
public @Nullable StatusEnum getStatus() {
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java
index 34510604ee4d..1f94a8ef63aa 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Tag.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A tag for a pet
*/
-@ApiModel(description = "A tag for a pet")
+@Schema(name = "Tag", description = "A tag for a pet")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class Tag {
@@ -38,7 +37,7 @@ public Tag id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -59,7 +58,7 @@ public Tag name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java
index c93944d5ea2e..ae9bf7482766 100644
--- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java
+++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/User.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -20,7 +19,7 @@
* A User who is purchasing from the pet store
*/
-@ApiModel(description = "A User who is purchasing from the pet store")
+@Schema(name = "User", description = "A User who is purchasing from the pet store")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class User {
@@ -50,7 +49,7 @@ public User id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -71,7 +70,7 @@ public User username(@Nullable String username) {
* @return username
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("username")
public @Nullable String getUsername() {
return username;
@@ -92,7 +91,7 @@ public User firstName(@Nullable String firstName) {
* @return firstName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("firstName")
public @Nullable String getFirstName() {
return firstName;
@@ -113,7 +112,7 @@ public User lastName(@Nullable String lastName) {
* @return lastName
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("lastName")
public @Nullable String getLastName() {
return lastName;
@@ -134,7 +133,7 @@ public User email(@Nullable String email) {
* @return email
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("email")
public @Nullable String getEmail() {
return email;
@@ -155,7 +154,7 @@ public User password(@Nullable String password) {
* @return password
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("password")
public @Nullable String getPassword() {
return password;
@@ -176,7 +175,7 @@ public User phone(@Nullable String phone) {
* @return phone
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("phone")
public @Nullable String getPhone() {
return phone;
@@ -197,7 +196,7 @@ public User userStatus(@Nullable Integer userStatus) {
* @return userStatus
*/
- @ApiModelProperty(value = "User Status")
+ @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("userStatus")
public @Nullable Integer getUserStatus() {
return userStatus;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
index 95a549621f7f..0f85b5e51c33 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
@@ -11,7 +11,7 @@ src/main/java/org/openapitools/api/StoreApi.java
src/main/java/org/openapitools/api/UserApi.java
src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
src/main/java/org/openapitools/configuration/HomeController.java
-src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
+src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
@@ -64,5 +64,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
-src/main/resources/static/swagger-ui.html
src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md
index 6721bbc28ca4..e6de7e038cea 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/README.md
@@ -7,17 +7,11 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
-The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox).
-Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the
-generated Controller and Model classes. The specification is available to download using the following url:
-http://localhost:80/v2/api-docs/
-
-**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer
-maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is
-supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is,
-as an added bonus, OpenAPI v3 compatible.
-
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
Start your server as a simple java application
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
index 155c833e4eb0..0bdddd0b839e 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
@@ -10,13 +10,13 @@
${java.version}
${java.version}
UTF-8
- 2.9.2
+ 1.6.14
5.3.1
org.springframework.boot
spring-boot-starter-parent
- 2.5.14
+ 2.7.15
@@ -39,20 +39,11 @@
org.springframework.data
spring-data-commons
-
+
- io.springfox
- springfox-swagger2
- ${springfox.version}
-
-
- org.webjars
- swagger-ui
- ${swagger-ui.version}
-
-
- org.webjars
- webjars-locator-core
+ org.springdoc
+ springdoc-openapi-ui
+ ${springdoc.version}
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java
index ed272236ed9b..109727169a95 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java
@@ -6,7 +6,18 @@
package org.openapitools.api;
import org.openapitools.model.Client;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -24,7 +35,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "$another-fake?", description = "the $another-fake? API")
+@Tag(name = "$another-fake?", description = "the $another-fake? API")
public interface AnotherFakeApi {
default Optional getRequest() {
@@ -39,16 +50,17 @@ default Optional getRequest() {
* @param client client model (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "call123testSpecialTags",
+ summary = "To test special tags",
+ description = "To test special tags and operation ID starting with number",
tags = { "$another-fake?" },
- value = "To test special tags",
- nickname = "call123testSpecialTags",
- notes = "To test special tags and operation ID starting with number",
- response = Client.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))
+ })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
@RequestMapping(
method = RequestMethod.PATCH,
value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS,
@@ -56,7 +68,7 @@ default Optional getRequest() {
consumes = { "application/json" }
)
default ResponseEntity call123testSpecialTags(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client
+ @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java
index 66d029d86844..4a35de79c8ea 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java
@@ -19,7 +19,18 @@
import org.openapitools.model.ResponseObjectWithDifferentFieldNames;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -37,7 +48,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "fake", description = "the fake API")
+@Tag(name = "fake", description = "the fake API")
public interface FakeApi {
default Optional getRequest() {
@@ -52,22 +63,22 @@ default Optional getRequest() {
* @param xmlItem XmlItem Body (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createXmlItem",
+ summary = "creates an XmlItem",
+ description = "this route creates an XmlItem",
tags = { "fake" },
- value = "creates an XmlItem",
- nickname = "createXmlItem",
- notes = "this route creates an XmlItem"
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_CREATE_XML_ITEM,
consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
)
default ResponseEntity createXmlItem(
- @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem
+ @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -82,16 +93,16 @@ default ResponseEntity createXmlItem(
* @param body Input boolean as post body (optional)
* @return Output boolean (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "fakeOuterBooleanSerialize",
+ description = "Test serialization of outer boolean types",
tags = { "fake" },
- value = "",
- nickname = "fakeOuterBooleanSerialize",
- notes = "Test serialization of outer boolean types",
- response = Boolean.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Output boolean", content = {
+ @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE,
@@ -99,7 +110,7 @@ default ResponseEntity createXmlItem(
consumes = { "application/json" }
)
default ResponseEntity fakeOuterBooleanSerialize(
- @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body
+ @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -114,16 +125,16 @@ default ResponseEntity fakeOuterBooleanSerialize(
* @param outerComposite Input composite as post body (optional)
* @return Output composite (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "fakeOuterCompositeSerialize",
+ description = "Test serialization of object with outer number type",
tags = { "fake" },
- value = "",
- nickname = "fakeOuterCompositeSerialize",
- notes = "Test serialization of object with outer number type",
- response = OuterComposite.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Output composite", content = {
+ @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE,
@@ -131,7 +142,7 @@ default ResponseEntity fakeOuterBooleanSerialize(
consumes = { "application/json" }
)
default ResponseEntity fakeOuterCompositeSerialize(
- @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite
+ @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -155,16 +166,16 @@ default ResponseEntity fakeOuterCompositeSerialize(
* @param body Input number as post body (optional)
* @return Output number (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "fakeOuterNumberSerialize",
+ description = "Test serialization of outer number types",
tags = { "fake" },
- value = "",
- nickname = "fakeOuterNumberSerialize",
- notes = "Test serialization of outer number types",
- response = BigDecimal.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Output number", content = {
+ @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE,
@@ -172,7 +183,7 @@ default ResponseEntity fakeOuterCompositeSerialize(
consumes = { "application/json" }
)
default ResponseEntity fakeOuterNumberSerialize(
- @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body
+ @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -187,16 +198,16 @@ default ResponseEntity fakeOuterNumberSerialize(
* @param body Input string as post body (optional)
* @return Output string (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "fakeOuterStringSerialize",
+ description = "Test serialization of outer string types",
tags = { "fake" },
- value = "",
- nickname = "fakeOuterStringSerialize",
- notes = "Test serialization of outer string types",
- response = String.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output string", response = String.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Output string", content = {
+ @Content(mediaType = "*/*", schema = @Schema(implementation = String.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE,
@@ -204,7 +215,7 @@ default ResponseEntity fakeOuterNumberSerialize(
consumes = { "application/json" }
)
default ResponseEntity fakeOuterStringSerialize(
- @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body
+ @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -218,23 +229,22 @@ default ResponseEntity fakeOuterStringSerialize(
* @param petId ID of pet to update (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "responseObjectDifferentNames",
tags = { "pet" },
- value = "",
- nickname = "responseObjectDifferentNames",
- notes = "",
- response = ResponseObjectWithDifferentFieldNames.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNames.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.GET,
value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES,
produces = { "application/json" }
)
default ResponseEntity responseObjectDifferentNames(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId
+ @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -258,22 +268,21 @@ default ResponseEntity responseObjectDiff
* @param fileSchemaTestClass (required)
* @return Success (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testBodyWithFileSchema",
+ description = "For this test, the body for this request much reference a schema named `File`.",
tags = { "fake" },
- value = "",
- nickname = "testBodyWithFileSchema",
- notes = "For this test, the body for this request much reference a schema named `File`."
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Success")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA,
consumes = { "application/json" }
)
default ResponseEntity testBodyWithFileSchema(
- @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass
+ @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -288,23 +297,21 @@ default ResponseEntity testBodyWithFileSchema(
* @param user (required)
* @return Success (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testBodyWithQueryParams",
tags = { "fake" },
- value = "",
- nickname = "testBodyWithQueryParams",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Success")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS,
consumes = { "application/json" }
)
default ResponseEntity testBodyWithQueryParams(
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,
- @ApiParam(value = "", required = true) @Valid @RequestBody User user
+ @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query,
+ @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -319,16 +326,17 @@ default ResponseEntity testBodyWithQueryParams(
* @param client client model (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testClientModel",
+ summary = "To test \"client\" model",
+ description = "To test \"client\" model",
tags = { "fake" },
- value = "To test \"client\" model",
- nickname = "testClientModel",
- notes = "To test \"client\" model",
- response = Client.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.PATCH,
value = FakeApi.PATH_TEST_CLIENT_MODEL,
@@ -336,7 +344,7 @@ default ResponseEntity testBodyWithQueryParams(
consumes = { "application/json" }
)
default ResponseEntity testClientModel(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client
+ @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -374,39 +382,39 @@ default ResponseEntity testClientModel(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testEndpointParameters",
+ summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
+ description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
tags = { "fake" },
- value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
- nickname = "testEndpointParameters",
- notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
- authorizations = {
- @Authorization(value = "http_basic_test")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ },
+ security = {
+ @SecurityRequirement(name = "http_basic_test")
+ }
+ )
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS,
consumes = { "application/x-www-form-urlencoded" }
)
default ResponseEntity testEndpointParameters(
- @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number,
- @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double,
- @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,
- @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte,
- @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer,
- @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32,
- @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64,
- @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float,
- @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string,
- @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary,
- @ApiParam(value = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
- @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
- @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password,
- @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback
+ @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number,
+ @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double,
+ @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,
+ @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte,
+ @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer,
+ @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32,
+ @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64,
+ @Parameter(name = "float", description = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float,
+ @Parameter(name = "string", description = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string,
+ @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary,
+ @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
+ @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
+ @Parameter(name = "password", description = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password,
+ @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -429,30 +437,30 @@ default ResponseEntity testEndpointParameters(
* @return Invalid request (status code 400)
* or Not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testEnumParameters",
+ summary = "To test enum parameters",
+ description = "To test enum parameters",
tags = { "fake" },
- value = "To test enum parameters",
- nickname = "testEnumParameters",
- notes = "To test enum parameters"
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid request"),
- @ApiResponse(code = 404, message = "Not found")
- })
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid request"),
+ @ApiResponse(responseCode = "404", description = "Not found")
+ }
+ )
@RequestMapping(
method = RequestMethod.GET,
value = FakeApi.PATH_TEST_ENUM_PARAMETERS,
consumes = { "application/x-www-form-urlencoded" }
)
default ResponseEntity testEnumParameters(
- @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray,
- @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString,
- @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray,
- @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
- @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger,
- @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble,
- @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,
- @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString
+ @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray,
+ @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString,
+ @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray,
+ @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
+ @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger,
+ @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble,
+ @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,
+ @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -472,26 +480,26 @@ default ResponseEntity testEnumParameters(
* @param int64Group Integer in group parameters (optional)
* @return Something wrong (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testGroupParameters",
+ summary = "Fake endpoint to test group parameters (optional)",
+ description = "Fake endpoint to test group parameters (optional)",
tags = { "fake" },
- value = "Fake endpoint to test group parameters (optional)",
- nickname = "testGroupParameters",
- notes = "Fake endpoint to test group parameters (optional)"
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Something wrong")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Something wrong")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = FakeApi.PATH_TEST_GROUP_PARAMETERS
)
default ResponseEntity testGroupParameters(
- @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,
- @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,
- @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,
- @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) @Nullable Integer stringGroup,
- @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) @Nullable Boolean booleanGroup,
- @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) @Nullable Long int64Group
+ @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,
+ @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,
+ @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,
+ @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) @Nullable Integer stringGroup,
+ @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) @Nullable Boolean booleanGroup,
+ @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) @Nullable Long int64Group
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -506,22 +514,22 @@ default ResponseEntity testGroupParameters(
* @param requestBody request body (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testInlineAdditionalProperties",
+ summary = "test inline additionalProperties",
+ description = "",
tags = { "fake" },
- value = "test inline additionalProperties",
- nickname = "testInlineAdditionalProperties",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES,
consumes = { "application/json" }
)
default ResponseEntity testInlineAdditionalProperties(
- @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody
+ @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -537,23 +545,23 @@ default ResponseEntity testInlineAdditionalProperties(
* @param param2 field2 (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testJsonFormData",
+ summary = "test json serialization of form data",
+ description = "",
tags = { "fake" },
- value = "test json serialization of form data",
- nickname = "testJsonFormData",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = FakeApi.PATH_TEST_JSON_FORM_DATA,
consumes = { "application/x-www-form-urlencoded" }
)
default ResponseEntity testJsonFormData(
- @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param,
- @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2
+ @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param,
+ @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -568,22 +576,22 @@ default ResponseEntity testJsonFormData(
* @param childWithNullable request body (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testNullable",
+ summary = "test nullable parent property",
+ description = "",
tags = { "fake" },
- value = "test nullable parent property",
- nickname = "testNullable",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_TEST_NULLABLE,
consumes = { "application/json" }
)
default ResponseEntity testNullable(
- @ApiParam(value = "request body", required = true) @Valid @RequestBody ChildWithNullable childWithNullable
+ @Parameter(name = "ChildWithNullable", description = "request body", required = true) @Valid @RequestBody ChildWithNullable childWithNullable
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -601,24 +609,23 @@ default ResponseEntity testNullable(
* @param context (required)
* @return Success (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testQueryParameterCollectionFormat",
+ description = "To test the collection format in query parameters",
tags = { "fake" },
- value = "",
- nickname = "testQueryParameterCollectionFormat",
- notes = "To test the collection format in query parameters"
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Success")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT
)
default ResponseEntity testQueryParameterCollectionFormat(
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context
+ @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe,
+ @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http,
+ @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url,
+ @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -632,16 +639,16 @@ default ResponseEntity testQueryParameterCollectionFormat(
*
* @return Success (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testWithResultExample",
+ description = "This endpoint defines an example value for its response schema.",
tags = { "fake" },
- value = "",
- nickname = "testWithResultExample",
- notes = "This endpoint defines an example value for its response schema.",
- response = Integer.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success", response = Integer.class)
- })
+ responses = {
+ @ApiResponse(responseCode = "200", description = "Success", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Integer.class))
+ })
+ }
+ )
@RequestMapping(
method = RequestMethod.GET,
value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE,
@@ -674,22 +681,20 @@ default ResponseEntity testWithResultExample(
* @param additionalMetadata Additional data to pass to server (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "uploadFileWithRequiredFile",
+ summary = "uploads an image (required)",
+ description = "",
tags = { "pet" },
- value = "uploads an image (required)",
- nickname = "uploadFileWithRequiredFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE,
@@ -697,9 +702,9 @@ default ResponseEntity testWithResultExample(
consumes = { "multipart/form-data" }
)
default ResponseEntity uploadFileWithRequiredFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata
+ @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId,
+ @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
+ @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
index 878513a1a30c..38082e99ec88 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
@@ -6,7 +6,18 @@
package org.openapitools.api;
import org.openapitools.model.Client;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -24,7 +35,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API")
+@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API")
public interface FakeClassnameTestApi {
default Optional getRequest() {
@@ -39,19 +50,20 @@ default Optional getRequest() {
* @param client client model (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "testClassname",
+ summary = "To test class name in snake case",
+ description = "To test class name in snake case",
tags = { "fake_classname_tags 123#$%^" },
- value = "To test class name in snake case",
- nickname = "testClassname",
- notes = "To test class name in snake case",
- response = Client.class,
- authorizations = {
- @Authorization(value = "api_key_query")
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key_query")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
@RequestMapping(
method = RequestMethod.PATCH,
value = FakeClassnameTestApi.PATH_TEST_CLASSNAME,
@@ -59,7 +71,7 @@ default Optional getRequest() {
consumes = { "application/json" }
)
default ResponseEntity testClassname(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client
+ @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java
index b3d3861e2a45..ae88a30184e0 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java
@@ -9,7 +9,18 @@
import org.springframework.lang.Nullable;
import org.openapitools.model.Pet;
import java.util.Set;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -27,7 +38,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "pet", description = "Everything about your Pets")
+@Tag(name = "pet", description = "Everything about your Pets")
public interface PetApi {
default Optional getRequest() {
@@ -43,29 +54,26 @@ default Optional getRequest() {
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "addPet",
+ summary = "Add a new pet to the store",
+ description = "",
tags = { "pet" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation"),
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_ADD_PET,
consumes = { "application/json", "application/xml" }
)
default ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -82,29 +90,26 @@ default ResponseEntity addPet(
* @return successful operation (status code 200)
* or Invalid pet value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deletePet",
+ summary = "Deletes a pet",
+ description = "",
tags = { "pet" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation"),
+ @ApiResponse(responseCode = "400", description = "Invalid pet value")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = PetApi.PATH_DELETE_PET
)
default ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey
+ @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) @Nullable String apiKey
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -120,31 +125,29 @@ default ResponseEntity deletePet(
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "findPetsByStatus",
+ summary = "Finds Pets by status",
+ description = "Multiple status values can be provided with comma separated strings",
tags = { "pet" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_STATUS,
produces = { "application/xml", "application/json" }
)
default ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status
+ @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
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -176,31 +179,30 @@ default ResponseEntity> findPetsByStatus(
* @deprecated
*/
@Deprecated
- @ApiOperation(
+ @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" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "Set",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ 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={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_FIND_PETS_BY_TAGS,
produces = { "application/xml", "application/json" }
)
default ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags
+ @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -231,28 +233,30 @@ default ResponseEntity> findPetsByTags(
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getPetById",
+ summary = "Find pet by ID",
+ description = "Returns a single pet",
tags = { "pet" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
+ 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")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = PetApi.PATH_GET_PET_BY_ID,
produces = { "application/xml", "application/json" }
)
default ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
+ @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -284,31 +288,28 @@ default ResponseEntity getPetById(
* or Pet not found (status code 404)
* or Validation exception (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePet",
+ summary = "Update an existing pet",
+ description = "",
tags = { "pet" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation"),
+ @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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = PetApi.PATH_UPDATE_PET,
consumes = { "application/json", "application/xml" }
)
default ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
+ @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -325,30 +326,27 @@ default ResponseEntity updatePet(
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updatePetWithForm",
+ summary = "Updates a pet in the store with form data",
+ description = "",
tags = { "pet" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
+ responses = {
+ @ApiResponse(responseCode = "405", description = "Invalid input")
+ },
+ security = {
+ @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPDATE_PET_WITH_FORM,
consumes = { "application/x-www-form-urlencoded" }
)
default ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status
+ @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
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -365,22 +363,20 @@ default ResponseEntity updatePetWithForm(
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "uploadFile",
+ summary = "uploads an image",
+ description = "",
tags = { "pet" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
+ 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" })
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = PetApi.PATH_UPLOAD_FILE,
@@ -388,9 +384,9 @@ default ResponseEntity updatePetWithForm(
consumes = { "multipart/form-data" }
)
default ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ @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
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java
index 317a6c2dd8ed..26bb56b39575 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java
@@ -7,7 +7,18 @@
import java.util.Map;
import org.openapitools.model.Order;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -25,7 +36,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "store", description = "Access to Petstore orders")
+@Tag(name = "store", description = "Access to Petstore orders")
public interface StoreApi {
default Optional getRequest() {
@@ -41,22 +52,22 @@ default Optional getRequest() {
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @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" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = StoreApi.PATH_DELETE_ORDER
)
default ResponseEntity deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId
+ @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -70,20 +81,20 @@ default ResponseEntity deleteOrder(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getInventory",
+ summary = "Returns pet inventories by status",
+ description = "Returns a map of status codes to quantities",
tags = { "store" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class))
+ })
+ },
+ security = {
+ @SecurityRequirement(name = "api_key")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_INVENTORY,
@@ -107,25 +118,27 @@ default ResponseEntity> getInventory(
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getOrderById",
+ summary = "Find purchase order by ID",
+ description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
tags = { "store" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
+ @ApiResponse(responseCode = "404", description = "Order not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = StoreApi.PATH_GET_ORDER_BY_ID,
produces = { "application/xml", "application/json" }
)
default ResponseEntity getOrderById(
- @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId
+ @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -155,17 +168,19 @@ default ResponseEntity getOrderById(
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "placeOrder",
+ summary = "Place an order for a pet",
+ description = "",
tags = { "store" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid Order")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
@RequestMapping(
method = RequestMethod.POST,
value = StoreApi.PATH_PLACE_ORDER,
@@ -173,7 +188,7 @@ default ResponseEntity getOrderById(
consumes = { "application/json" }
)
default ResponseEntity placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
+ @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java
index 19182a0968d7..8e54ff471a7e 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java
@@ -7,7 +7,18 @@
import java.time.OffsetDateTime;
import org.openapitools.model.User;
-import io.swagger.annotations.*;
+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 io.swagger.v3.oas.annotations.media.ExampleObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -25,7 +36,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
@Validated
-@Api(value = "user", description = "Operations about user")
+@Tag(name = "user", description = "Operations about user")
public interface UserApi {
default Optional getRequest() {
@@ -40,22 +51,22 @@ default Optional getRequest() {
* @param user Created user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUser",
+ summary = "Create user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USER,
consumes = { "application/json" }
)
default ResponseEntity createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -70,22 +81,22 @@ default ResponseEntity createUser(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithArrayInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT,
consumes = { "application/json" }
)
default ResponseEntity createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -100,22 +111,22 @@ default ResponseEntity createUsersWithArrayInput(
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "createUsersWithListInput",
+ summary = "Creates list of users with given input array",
+ description = "",
tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT,
consumes = { "application/json" }
)
default ResponseEntity createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
+ @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<@Valid User> user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -131,22 +142,22 @@ default ResponseEntity createUsersWithListInput(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "deleteUser",
+ summary = "Delete user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = UserApi.PATH_DELETE_USER
)
default ResponseEntity deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -163,25 +174,27 @@ default ResponseEntity deleteUser(
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "getUserByName",
+ summary = "Get user by user name",
+ description = "",
tags = { "user" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_GET_USER_BY_NAME,
produces = { "application/xml", "application/json" }
)
default ResponseEntity getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
+ @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -212,25 +225,27 @@ default ResponseEntity getUserByName(
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "loginUser",
+ summary = "Logs user into the system",
+ description = "",
tags = { "user" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
+ responses = {
+ @ApiResponse(responseCode = "200", description = "successful operation", content = {
+ @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)),
+ @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))
+ }),
+ @ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGIN_USER,
produces = { "application/xml", "application/json" }
)
default ResponseEntity loginUser(
- @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
+ @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -244,15 +259,15 @@ default ResponseEntity loginUser(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "logoutUser",
+ summary = "Logs out current logged in user session",
+ description = "",
tags = { "user" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = ""
+ responses = {
+ @ApiResponse(responseCode = "default", description = "successful operation")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = UserApi.PATH_LOGOUT_USER
@@ -275,24 +290,24 @@ default ResponseEntity logoutUser(
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
+ @Operation(
+ operationId = "updateUser",
+ summary = "Updated user",
+ description = "This can only be done by the logged in user.",
tags = { "user" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user."
+ responses = {
+ @ApiResponse(responseCode = "400", description = "Invalid user supplied"),
+ @ApiResponse(responseCode = "404", description = "User not found")
+ }
)
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = UserApi.PATH_UPDATE_USER,
consumes = { "application/json" }
)
default ResponseEntity updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
+ @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
+ @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
index e390f86f5b73..9aa29284ab5f 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
@@ -12,14 +12,6 @@
@Controller
public class HomeController {
- static final String API_DOCS_PATH = "/v2/api-docs";
-
- @GetMapping(value = "/swagger-config.yaml", produces = "text/plain")
- @ResponseBody
- public String swaggerConfig() {
- return "url: " + API_DOCS_PATH + "\n";
- }
-
@RequestMapping("/")
public String index() {
return "redirect:swagger-ui.html";
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
new file mode 100644
index 000000000000..a32f1f677870
--- /dev/null
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
@@ -0,0 +1,52 @@
+package org.openapitools.configuration;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.info.Contact;
+import io.swagger.v3.oas.models.info.License;
+import io.swagger.v3.oas.models.Components;
+import io.swagger.v3.oas.models.security.SecurityScheme;
+
+@Configuration
+public class SpringDocConfiguration {
+
+ @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo")
+ OpenAPI apiInfo() {
+ return new OpenAPI()
+ .info(
+ new Info()
+ .title("OpenAPI Petstore")
+ .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
+ .license(
+ new License()
+ .name("Apache-2.0")
+ .url("https://www.apache.org/licenses/LICENSE-2.0.html")
+ )
+ .version("1.0.0")
+ )
+ .components(
+ new Components()
+ .addSecuritySchemes("petstore_auth", new SecurityScheme()
+ .type(SecurityScheme.Type.OAUTH2)
+ )
+ .addSecuritySchemes("api_key", new SecurityScheme()
+ .type(SecurityScheme.Type.APIKEY)
+ .in(SecurityScheme.In.HEADER)
+ .name("api_key")
+ )
+ .addSecuritySchemes("api_key_query", new SecurityScheme()
+ .type(SecurityScheme.Type.APIKEY)
+ .in(SecurityScheme.In.QUERY)
+ .name("api_key_query")
+ )
+ .addSecuritySchemes("http_basic_test", new SecurityScheme()
+ .type(SecurityScheme.Type.HTTP)
+ .scheme("basic")
+ )
+ )
+ ;
+ }
+}
\ No newline at end of file
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
deleted file mode 100644
index fb3561a8f002..000000000000
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import org.springframework.web.util.UriComponentsBuilder;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.paths.Paths;
-import springfox.documentation.spring.web.paths.RelativePathProvider;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import javax.annotation.Generated;
-import javax.servlet.ServletContext;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
-@Configuration
-@EnableSwagger2
-public class SpringFoxConfiguration {
-
- ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("OpenAPI Petstore")
- .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
- .license("Apache-2.0")
- .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
- .termsOfServiceUrl("")
- .version("1.0.0")
- .contact(new Contact("","", ""))
- .build();
- }
-
- @Bean
- public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) {
- return new Docket(DocumentationType.SWAGGER_2)
- .select()
- .apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
- .build()
- .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
- .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
- .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
- .apiInfo(apiInfo());
- }
-
- class BasePathAwareRelativePathProvider extends RelativePathProvider {
- private String basePath;
-
- public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) {
- super(servletContext);
- this.basePath = basePath;
- }
-
- @Override
- protected String applicationPath() {
- return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString());
- }
-
- @Override
- public String getOperationPath(String operationPath) {
- UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
- return Paths.removeAdjacentForwardSlashes(
- uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString());
- }
- }
-
-}
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
index 1b9f780290a5..bf3527f0045f 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -38,7 +37,7 @@ public AdditionalPropertiesAnyType name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
index 9b1f8010ca4d..0c3551e393a4 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -39,7 +38,7 @@ public AdditionalPropertiesArray name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
index 1248b13ef242..ff3b8401ed46 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -38,7 +37,7 @@ public AdditionalPropertiesBoolean name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
index d080f0ad9fd3..2b20c67613ff 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -74,7 +73,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt
* @return mapString
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_string")
public Map getMapString() {
return mapString;
@@ -103,7 +102,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb
* @return mapNumber
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_number")
public Map getMapNumber() {
return mapNumber;
@@ -132,7 +131,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege
* @return mapInteger
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_integer")
public Map getMapInteger() {
return mapInteger;
@@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea
* @return mapBoolean
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_boolean")
public Map getMapBoolean() {
return mapBoolean;
@@ -190,7 +189,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() {
return mapArrayInteger;
@@ -219,7 +218,7 @@ public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List
* @return mapArrayAnytype
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_array_anytype")
public Map> getMapArrayAnytype() {
return mapArrayAnytype;
@@ -248,7 +247,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() {
return mapMapString;
@@ -277,7 +276,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() {
return mapMapAnytype;
@@ -298,7 +297,7 @@ public AdditionalPropertiesClass anytype1(@Nullable Object anytype1) {
* @return anytype1
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("anytype_1")
public @Nullable Object getAnytype1() {
return anytype1;
@@ -319,7 +318,7 @@ public AdditionalPropertiesClass anytype2(@Nullable Object anytype2) {
* @return anytype2
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("anytype_2")
public @Nullable Object getAnytype2() {
return anytype2;
@@ -340,7 +339,7 @@ public AdditionalPropertiesClass anytype3(@Nullable Object anytype3) {
* @return anytype3
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("anytype_3")
public @Nullable Object getAnytype3() {
return anytype3;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
index c27cfb099434..73814c1c28f6 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -38,7 +37,7 @@ public AdditionalPropertiesInteger name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
index aac0e9d84a64..bcd363693e96 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -39,7 +38,7 @@ public AdditionalPropertiesNumber name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
index ba5b4d037d23..0a9cc343c936 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
@@ -4,13 +4,12 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -39,7 +38,7 @@ public AdditionalPropertiesObject name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
index 39f39353e6aa..1391895d9b9e 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -38,7 +37,7 @@ public AdditionalPropertiesString name(@Nullable String name) {
* @return name
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("name")
public @Nullable String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java
index 1718c0a91051..cf044aa47f7f 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java
@@ -7,12 +7,11 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -61,7 +60,7 @@ public Animal className(String className) {
* @return className
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("className")
public String getClassName() {
return className;
@@ -82,7 +81,7 @@ public Animal color(String color) {
* @return color
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("color")
public String getColor() {
return color;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
index 7b2cab3e5fcf..1c9493e213e2 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -47,7 +46,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr
* @return arrayArrayNumber
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("ArrayArrayNumber")
public List> getArrayArrayNumber() {
return arrayArrayNumber;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
index e9e5da8316b5..ffc16c8e26f6 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -47,7 +46,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
* @return arrayNumber
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("ArrayNumber")
public List getArrayNumber() {
return arrayNumber;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java
index fb8e9f6e83d3..6b95eef36887 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -53,7 +52,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
* @return arrayOfString
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("array_of_string")
public List getArrayOfString() {
return arrayOfString;
@@ -82,7 +81,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem)
* @return arrayArrayOfInteger
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("array_array_of_integer")
public List> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
@@ -111,7 +110,7 @@ public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayO
* @return arrayArrayOfModel
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("array_array_of_model")
public List> getArrayArrayOfModel() {
return arrayArrayOfModel;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java
index 9ca60d82553e..3cff72d49bd9 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java
@@ -8,13 +8,12 @@
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Cat;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -90,7 +89,7 @@ public BigCat kind(@Nullable KindEnum kind) {
* @return kind
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("kind")
public @Nullable KindEnum getKind() {
return kind;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java
index c550cc0543f7..1325b6165558 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -44,7 +43,7 @@ public Capitalization smallCamel(@Nullable String smallCamel) {
* @return smallCamel
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("smallCamel")
public @Nullable String getSmallCamel() {
return smallCamel;
@@ -65,7 +64,7 @@ public Capitalization capitalCamel(@Nullable String capitalCamel) {
* @return capitalCamel
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("CapitalCamel")
public @Nullable String getCapitalCamel() {
return capitalCamel;
@@ -86,7 +85,7 @@ public Capitalization smallSnake(@Nullable String smallSnake) {
* @return smallSnake
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("small_Snake")
public @Nullable String getSmallSnake() {
return smallSnake;
@@ -107,7 +106,7 @@ public Capitalization capitalSnake(@Nullable String capitalSnake) {
* @return capitalSnake
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("Capital_Snake")
public @Nullable String getCapitalSnake() {
return capitalSnake;
@@ -128,7 +127,7 @@ public Capitalization scAETHFlowPoints(@Nullable String scAETHFlowPoints) {
* @return scAETHFlowPoints
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("SCA_ETH_Flow_Points")
public @Nullable String getScAETHFlowPoints() {
return scAETHFlowPoints;
@@ -149,7 +148,7 @@ public Capitalization ATT_NAME(@Nullable String ATT_NAME) {
* @return ATT_NAME
*/
- @ApiModelProperty(value = "Name of the pet ")
+ @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("ATT_NAME")
public @Nullable String getATTNAME() {
return ATT_NAME;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java
index fd407bcaee17..57d9bda2cfda 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java
@@ -7,13 +7,12 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Animal;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -58,7 +57,7 @@ public Cat declawed(@Nullable Boolean declawed) {
* @return declawed
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("declawed")
public @Nullable Boolean getDeclawed() {
return declawed;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java
index 7cc547f94eb1..83e2e1678891 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -47,7 +46,7 @@ public Category id(@Nullable Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("id")
public @Nullable Long getId() {
return id;
@@ -68,7 +67,7 @@ public Category name(String name) {
* @return name
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("name")
public String getName() {
return name;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java
index 03d9017ffda6..5639877f342d 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ChildWithNullable.java
@@ -8,13 +8,12 @@
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.ParentWithNullable;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -40,7 +39,7 @@ public ChildWithNullable otherProperty(@Nullable String otherProperty) {
* @return otherProperty
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("otherProperty")
public @Nullable String getOtherProperty() {
return otherProperty;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java
index bbcbb670a843..91668bae1e1c 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -19,7 +18,7 @@
* Model for testing model with \"_class\" property
*/
-@ApiModel(description = "Model for testing model with \"_class\" property")
+@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class ClassModel {
@@ -35,7 +34,7 @@ public ClassModel propertyClass(@Nullable String propertyClass) {
* @return propertyClass
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("_class")
public @Nullable String getPropertyClass() {
return propertyClass;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java
index 03da69e99ca2..a332cacb5552 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -34,7 +33,7 @@ public Client client(@Nullable String client) {
* @return client
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("client")
public @Nullable String getClient() {
return client;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java
index 21fe2cdea231..6bd259522bd9 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -13,6 +11,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -67,7 +66,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) {
* @return nullableArray
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("nullable_array")
public @Nullable List getNullableArray() {
return nullableArray;
@@ -96,7 +95,7 @@ public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequire
* @return nullableRequiredArray
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("nullable_required_array")
public List getNullableRequiredArray() {
return nullableRequiredArray;
@@ -125,7 +124,7 @@ public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) {
* @return requiredArray
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("required_array")
public List getRequiredArray() {
return requiredArray;
@@ -154,7 +153,7 @@ public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArra
* @return nullableArrayWithDefault
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("nullable_array_with_default")
public @Nullable List getNullableArrayWithDefault() {
return nullableArrayWithDefault;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java
index 37ce81693d73..579a3f2e36e0 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java
@@ -7,13 +7,12 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.Animal;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -50,7 +49,7 @@ public Dog breed(@Nullable String breed) {
* @return breed
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("breed")
public @Nullable String getBreed() {
return breed;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java
index 2e82d3d8de52..83b3984f552b 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -111,7 +110,7 @@ public EnumArrays justSymbol(@Nullable JustSymbolEnum justSymbol) {
* @return justSymbol
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("just_symbol")
public @Nullable JustSymbolEnum getJustSymbol() {
return justSymbol;
@@ -140,7 +139,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
* @return arrayEnum
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("array_enum")
public List getArrayEnum() {
return arrayEnum;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java
index 9bc0b3fed05c..88c3e50c407f 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java
@@ -6,6 +6,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java
index 859d6fc1c1d9..b6873c1586d3 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java
@@ -6,13 +6,12 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.model.OuterEnum;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -201,7 +200,7 @@ public EnumTest enumString(@Nullable EnumStringEnum enumString) {
* @return enumString
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("enum_string")
public @Nullable EnumStringEnum getEnumString() {
return enumString;
@@ -222,7 +221,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
* @return enumStringRequired
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("enum_string_required")
public EnumStringRequiredEnum getEnumStringRequired() {
return enumStringRequired;
@@ -243,7 +242,7 @@ public EnumTest enumInteger(@Nullable EnumIntegerEnum enumInteger) {
* @return enumInteger
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("enum_integer")
public @Nullable EnumIntegerEnum getEnumInteger() {
return enumInteger;
@@ -264,7 +263,7 @@ public EnumTest enumNumber(@Nullable EnumNumberEnum enumNumber) {
* @return enumNumber
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("enum_number")
public @Nullable EnumNumberEnum getEnumNumber() {
return enumNumber;
@@ -285,7 +284,7 @@ public EnumTest outerEnum(@Nullable OuterEnum outerEnum) {
* @return outerEnum
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("outerEnum")
public @Nullable OuterEnum getOuterEnum() {
return outerEnum;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java
index 78459e9be890..76203301fef7 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java
@@ -4,12 +4,11 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -19,7 +18,7 @@
* Must be named `File` for test.
*/
-@ApiModel(description = "Must be named `File` for test.")
+@Schema(name = "File", description = "Must be named `File` for test.")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT")
public class File {
@@ -35,7 +34,7 @@ public File sourceURI(@Nullable String sourceURI) {
* @return sourceURI
*/
- @ApiModelProperty(value = "Test capitalization")
+ @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("sourceURI")
public @Nullable String getSourceURI() {
return sourceURI;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java
index 9d82b8fde8da..8683cb414b85 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@@ -14,6 +12,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -41,7 +40,7 @@ public FileSchemaTestClass file(@Nullable File file) {
* @return file
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("file")
public @Nullable File getFile() {
return file;
@@ -70,7 +69,7 @@ public FileSchemaTestClass addFilesItem(File filesItem) {
* @return files
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("files")
public List<@Valid File> getFiles() {
return files;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java
index 8743c0e4230c..edfab7150045 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
@@ -17,6 +15,7 @@
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -86,7 +85,7 @@ public FormatTest integer(@Nullable Integer integer) {
* @return integer
*/
@Min(value = 10) @Max(value = 100)
- @ApiModelProperty(value = "")
+ @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("integer")
public @Nullable Integer getInteger() {
return integer;
@@ -109,7 +108,7 @@ public FormatTest int32(@Nullable Integer int32) {
* @return int32
*/
@Min(value = 20) @Max(value = 200)
- @ApiModelProperty(value = "")
+ @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("int32")
public @Nullable Integer getInt32() {
return int32;
@@ -130,7 +129,7 @@ public FormatTest int64(@Nullable Long int64) {
* @return int64
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("int64")
public @Nullable Long getInt64() {
return int64;
@@ -153,7 +152,7 @@ public FormatTest number(BigDecimal number) {
* @return number
*/
@NotNull @Valid @DecimalMin(value = "32.1") @DecimalMax(value = "543.2")
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("number")
public BigDecimal getNumber() {
return number;
@@ -176,7 +175,7 @@ public FormatTest _float(@Nullable Float _float) {
* @return _float
*/
@DecimalMin(value = "54.3") @DecimalMax(value = "987.6")
- @ApiModelProperty(value = "")
+ @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("float")
public @Nullable Float getFloat() {
return _float;
@@ -199,7 +198,7 @@ public FormatTest _double(@Nullable Double _double) {
* @return _double
*/
@DecimalMin(value = "67.8") @DecimalMax(value = "123.4")
- @ApiModelProperty(value = "")
+ @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("double")
public @Nullable Double getDouble() {
return _double;
@@ -220,7 +219,7 @@ public FormatTest string(@Nullable String string) {
* @return string
*/
@Pattern(regexp = "/[a-z]/i")
- @ApiModelProperty(value = "")
+ @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("string")
public @Nullable String getString() {
return string;
@@ -241,7 +240,7 @@ public FormatTest _byte(byte[] _byte) {
* @return _byte
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("byte")
public byte[] getByte() {
return _byte;
@@ -262,7 +261,7 @@ public FormatTest binary(@Nullable org.springframework.core.io.Resource binary)
* @return binary
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("binary")
public @Nullable org.springframework.core.io.Resource getBinary() {
return binary;
@@ -283,7 +282,7 @@ public FormatTest date(LocalDate date) {
* @return date
*/
@NotNull @Valid
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("date")
public LocalDate getDate() {
return date;
@@ -304,7 +303,7 @@ public FormatTest dateTime(@Nullable OffsetDateTime dateTime) {
* @return dateTime
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("dateTime")
public @Nullable OffsetDateTime getDateTime() {
return dateTime;
@@ -325,7 +324,7 @@ public FormatTest uuid(@Nullable UUID uuid) {
* @return uuid
*/
@Valid
- @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
+ @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("uuid")
public @Nullable UUID getUuid() {
return uuid;
@@ -346,7 +345,7 @@ public FormatTest password(String password) {
* @return password
*/
@NotNull @Size(min = 10, max = 64)
- @ApiModelProperty(required = true, value = "")
+ @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED)
@JsonProperty("password")
public String getPassword() {
return password;
@@ -367,7 +366,7 @@ public FormatTest bigDecimal(@Nullable BigDecimal bigDecimal) {
* @return bigDecimal
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("BigDecimal")
public @Nullable BigDecimal getBigDecimal() {
return bigDecimal;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
index c6ea38055cf4..84d819f91654 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
@@ -5,12 +5,11 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -38,7 +37,7 @@ public HasOnlyReadOnly bar(@Nullable String bar) {
* @return bar
*/
- @ApiModelProperty(readOnly = true, value = "")
+ @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("bar")
public @Nullable String getBar() {
return bar;
@@ -59,7 +58,7 @@ public HasOnlyReadOnly foo(@Nullable String foo) {
* @return foo
*/
- @ApiModelProperty(readOnly = true, value = "")
+ @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("foo")
public @Nullable String getFoo() {
return foo;
diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java
index ff4aadfa9e0f..9f9abc4e2c44 100644
--- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java
+++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java
@@ -5,14 +5,13 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import org.springframework.lang.Nullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
+import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
@@ -90,7 +89,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr
* @return mapMapOfString
*/
@Valid
- @ApiModelProperty(value = "")
+ @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_map_of_string")
public Map> getMapMapOfString() {
return mapMapOfString;
@@ -119,7 +118,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem)
* @return mapOfEnumString
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("map_of_enum_string")
public Map getMapOfEnumString() {
return mapOfEnumString;
@@ -148,7 +147,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) {
* @return directMap
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("direct_map")
public Map getDirectMap() {
return directMap;
@@ -177,7 +176,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
* @return indirectMap
*/
- @ApiModelProperty(value = "")
+ @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
@JsonProperty("indirect_map")
public Map