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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0b0f33e3a468..9dddda47ee66 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -46,7 +45,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -67,7 +66,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -96,7 +95,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java index 9702a1a004d1..7c494f5ad5f1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.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.*; @@ -20,7 +19,7 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -39,7 +38,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -60,7 +59,7 @@ public Model200Response 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/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java index 9cf059def20f..566924c317b5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.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.*; @@ -40,7 +39,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; @@ -61,7 +60,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; @@ -82,7 +81,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/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java index 3cc15aa19396..be51fab2c1f1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.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.*; @@ -36,7 +35,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java index 075f319abe4d..a6daa7d2bdc0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.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.*; @@ -20,7 +19,7 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -37,7 +36,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java index c37cb0b5c228..c4bcc1476e07 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.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 name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -52,7 +51,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -73,7 +72,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -94,7 +93,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -115,7 +114,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java index fcb0edf1b593..c8ae76ca9211 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NullableMapProperty.java @@ -4,14 +4,13 @@ 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.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.*; @@ -45,7 +44,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public @Nullable Map getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java index fa196d4af194..19716a323430 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.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.*; @@ -35,7 +34,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java index 12d182b555f3..049e3546c6bc 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.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.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; 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.*; @@ -85,7 +84,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; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -169,7 +168,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; @@ -190,7 +189,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/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java index 8f9084d82490..ffd64bdef733 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.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 OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -60,7 +59,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -81,7 +80,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java index 67cd6db0a5ad..a920379e10d5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.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/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java index b8e2422d81f9..906d2ece3244 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,12 +8,11 @@ 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.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.*; @@ -82,7 +81,7 @@ public ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -103,7 +102,7 @@ public ParentWithNullable nullableProperty(@Nullable String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public @Nullable String getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index ace4c240a67a..69fae8d182f3 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -105,7 +104,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; @@ -126,7 +125,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; @@ -147,7 +146,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; @@ -176,7 +175,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -206,7 +205,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; @@ -228,7 +227,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/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 04224bbc6096..69734dd72cab 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -36,7 +35,7 @@ public ReadOnlyFirst 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; @@ -57,7 +56,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 661ab3f6a788..092e5f798447 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -40,7 +39,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -61,7 +60,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -82,7 +81,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -103,7 +102,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 1706685dc9d9..546ad0eff590 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -36,7 +35,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java index d6df673b64fd..a340256b6599 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.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.*; @@ -36,7 +35,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; @@ -57,7 +56,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/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 47801ca61574..f393e6ebdf84 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.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.*; @@ -62,7 +61,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -83,7 +82,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -104,7 +103,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -125,7 +124,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -154,7 +153,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index c4d9cd9bf862..1104e5374b52 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.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.*; @@ -65,7 +64,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -86,7 +85,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -107,7 +106,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -128,7 +127,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -149,7 +148,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -178,7 +177,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java index 54a37a4adb3c..36180c7110e1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.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.*; @@ -48,7 +47,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; @@ -69,7 +68,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; @@ -90,7 +89,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; @@ -111,7 +110,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; @@ -132,7 +131,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; @@ -153,7 +152,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; @@ -174,7 +173,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; @@ -195,7 +194,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/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 072e0627d951..5391948f00a1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.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.*; @@ -103,7 +102,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -124,7 +123,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -145,7 +144,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -166,7 +165,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -195,7 +194,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -216,7 +215,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -237,7 +236,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -258,7 +257,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -279,7 +278,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -308,7 +307,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -337,7 +336,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -358,7 +357,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -379,7 +378,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -400,7 +399,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -421,7 +420,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -450,7 +449,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -479,7 +478,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -500,7 +499,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -521,7 +520,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -542,7 +541,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -563,7 +562,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -592,7 +591,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -621,7 +620,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -642,7 +641,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -663,7 +662,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -684,7 +683,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -705,7 +704,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -734,7 +733,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -763,7 +762,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index 5e2378b3ee8c..0f85b5e51c33 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.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 diff --git a/samples/server/petstore/springboot-beanvalidation/README.md b/samples/server/petstore/springboot-beanvalidation/README.md index ce826ea62754..58d369f0b2cf 100644 --- a/samples/server/petstore/springboot-beanvalidation/README.md +++ b/samples/server/petstore/springboot-beanvalidation/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 Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index 775c3576bd95..bb7669fa883a 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -10,12 +10,12 @@ ${java.version} ${java.version} UTF-8 - 2.9.2 + 1.6.14 org.springframework.boot spring-boot-starter-parent - 2.5.14 + 2.7.15 @@ -38,11 +38,11 @@ org.springframework.data spring-data-commons - + - io.springfox - springfox-swagger2 - ${springfox.version} + org.springdoc + springdoc-openapi-webmvc-core + ${springdoc.version} diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index ed272236ed9b..109727169a95 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 66d029d86844..4a35de79c8ea 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 878513a1a30c..38082e99ec88 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b3d3861e2a45..ae88a30184e0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 317a6c2dd8ed..26bb56b39575 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 19182a0968d7..8e54ff471a7e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-beanvalidation/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/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -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.*; @@ -48,7 +47,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/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -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.*; @@ -48,7 +47,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/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-builtin-validation/.openapi-generator/FILES b/samples/server/petstore/springboot-builtin-validation/.openapi-generator/FILES index 5e2378b3ee8c..0f85b5e51c33 100644 --- a/samples/server/petstore/springboot-builtin-validation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-builtin-validation/.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 diff --git a/samples/server/petstore/springboot-builtin-validation/README.md b/samples/server/petstore/springboot-builtin-validation/README.md index ce826ea62754..58d369f0b2cf 100644 --- a/samples/server/petstore/springboot-builtin-validation/README.md +++ b/samples/server/petstore/springboot-builtin-validation/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 Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-builtin-validation/pom.xml b/samples/server/petstore/springboot-builtin-validation/pom.xml index 8bfeeaca1ddc..c92930e7d40d 100644 --- a/samples/server/petstore/springboot-builtin-validation/pom.xml +++ b/samples/server/petstore/springboot-builtin-validation/pom.xml @@ -10,12 +10,12 @@ ${java.version} ${java.version} UTF-8 - 2.9.2 + 1.6.14 org.springframework.boot spring-boot-starter-parent - 2.5.14 + 2.7.15 @@ -38,11 +38,11 @@ org.springframework.data spring-data-commons - + - io.springfox - springfox-swagger2 - ${springfox.version} + org.springdoc + springdoc-openapi-webmvc-core + ${springdoc.version} diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 255b967dd223..8fd0af9f84c6 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java index d67695f72da6..d5ad7ab3b311 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d22beb5b96af..7845ae7f9f79 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java index 82c2298d83e1..743abab9d1f9 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java index e86068f09175..1c1626499fe2 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java index ba19f8f80306..23c4f56ba252 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-builtin-validation/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") -@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-builtin-validation/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-builtin-validation/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-builtin-validation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-builtin-validation/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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-builtin-validation/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-builtin-validation/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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-builtin-validation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -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.*; @@ -48,7 +47,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-builtin-validation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -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.*; @@ -48,7 +47,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-builtin-validation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-builtin-validation/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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-builtin-validation/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-builtin-validation/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-builtin-validation/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-builtin-validation/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-builtin-validation/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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-builtin-validation/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-builtin-validation/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-builtin-validation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-builtin-validation/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-builtin-validation/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-builtin-validation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-builtin-validation/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-builtin-validation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-builtin-validation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-builtin-validation/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-builtin-validation/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-builtin-validation/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-builtin-validation/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-builtin-validation/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-builtin-validation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index d568b26f5bef..c875e2014289 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -17,7 +17,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiDelegate.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 @@ -70,5 +70,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-delegate-j8/README.md b/samples/server/petstore/springboot-delegate-j8/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-delegate-j8/README.md +++ b/samples/server/petstore/springboot-delegate-j8/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-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index 1b2f99ebb70b..1c768f30df43 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/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-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 83a097e36e90..d16358fd8162 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 AnotherFakeApiDelegate getDelegate() { @@ -35,16 +46,17 @@ default AnotherFakeApiDelegate getDelegate() { * @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, @@ -52,7 +64,7 @@ default AnotherFakeApiDelegate getDelegate() { 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 ) { return getDelegate().call123testSpecialTags(client); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 5061839983bd..a7e9a410a2b5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -33,7 +44,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 FakeApiDelegate getDelegate() { @@ -48,22 +59,22 @@ default FakeApiDelegate getDelegate() { * @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 getDelegate().createXmlItem(xmlItem); } @@ -77,16 +88,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, @@ -94,7 +105,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 getDelegate().fakeOuterBooleanSerialize(body); } @@ -108,16 +119,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, @@ -125,7 +136,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 ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -139,16 +150,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, @@ -156,7 +167,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 getDelegate().fakeOuterNumberSerialize(body); } @@ -170,16 +181,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, @@ -187,7 +198,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 getDelegate().fakeOuterStringSerialize(body); } @@ -200,23 +211,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 ) { return getDelegate().responseObjectDifferentNames(petId); } @@ -230,22 +240,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 getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -259,23 +268,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 getDelegate().testBodyWithQueryParams(query, user); } @@ -289,16 +296,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, @@ -306,7 +314,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 ) { return getDelegate().testClientModel(client); } @@ -334,39 +342,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 getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -388,30 +396,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 getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -430,26 +438,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 getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -463,22 +471,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 getDelegate().testInlineAdditionalProperties(requestBody); } @@ -493,23 +501,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 getDelegate().testJsonFormData(param, param2); } @@ -523,22 +531,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 getDelegate().testNullable(childWithNullable); } @@ -555,24 +563,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 getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } @@ -585,16 +592,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, @@ -617,22 +624,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, @@ -640,9 +645,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 ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 50d706663cb6..ea64a6ded979 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 FakeClassnameTestApiDelegate getDelegate() { @@ -35,19 +46,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @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, @@ -55,7 +67,7 @@ default FakeClassnameTestApiDelegate getDelegate() { 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 ) { return getDelegate().testClassname(client); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 86fa601ab409..fd4b68a0469b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.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 { default PetApiDelegate getDelegate() { @@ -39,29 +50,26 @@ default PetApiDelegate getDelegate() { * @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 getDelegate().addPet(pet); } @@ -77,29 +85,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 getDelegate().deletePet(petId, apiKey); } @@ -114,31 +119,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 ) { return getDelegate().findPetsByStatus(status); } @@ -155,31 +158,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 ) { return getDelegate().findPetsByTags(tags); } @@ -195,28 +197,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 ) { return getDelegate().getPetById(petId); } @@ -233,31 +237,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 getDelegate().updatePet(pet); } @@ -273,30 +274,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 getDelegate().updatePetWithForm(petId, name, status); } @@ -312,22 +310,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, @@ -335,9 +331,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 ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 4c941c2018c9..0fd8220f6e74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -21,7 +32,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 StoreApiDelegate getDelegate() { @@ -37,22 +48,22 @@ default StoreApiDelegate getDelegate() { * @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 getDelegate().deleteOrder(orderId); } @@ -65,20 +76,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, @@ -101,25 +112,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 ) { return getDelegate().getOrderById(orderId); } @@ -134,17 +147,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, @@ -152,7 +167,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 ) { return getDelegate().placeOrder(order); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 63a3458382fb..7ce48030a454 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -21,7 +32,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 UserApiDelegate getDelegate() { @@ -36,22 +47,22 @@ default UserApiDelegate getDelegate() { * @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 getDelegate().createUser(user); } @@ -65,22 +76,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 getDelegate().createUsersWithArrayInput(user); } @@ -94,22 +105,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 getDelegate().createUsersWithListInput(user); } @@ -124,22 +135,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 getDelegate().deleteUser(username); } @@ -155,25 +166,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 ) { return getDelegate().getUserByName(username); } @@ -189,25 +202,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 getDelegate().loginUser(username, password); } @@ -220,15 +235,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 @@ -250,24 +265,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 getDelegate().updateUser(username, user); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate-j8/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-delegate-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/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-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-delegate-j8/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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-delegate-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -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.*; @@ -48,7 +47,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-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -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.*; @@ -48,7 +47,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-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-delegate-j8/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-delegate-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-delegate-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-delegate-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-delegate-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES index 8b682c5e7ceb..7bcd6d2efc85 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-no-response-entity/.openapi-generator/FILES @@ -10,7 +10,7 @@ src/main/java/org/openapitools/api/StoreApiDelegate.java src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiDelegate.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/Category.java src/main/java/org/openapitools/model/ModelApiResponse.java src/main/java/org/openapitools/model/Order.java @@ -19,5 +19,4 @@ src/main/java/org/openapitools/model/Tag.java src/main/java/org/openapitools/model/User.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-delegate-no-response-entity/README.md b/samples/server/petstore/springboot-delegate-no-response-entity/README.md index 54292416f462..5cd22b6081a2 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/README.md +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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:8080/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:8080/v3/api-docs/ Start your server as a simple java application diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml b/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml index d9b55dc2bd39..edb042fedefa 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/pom.xml +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java index aa093ce5a483..0eb084307803 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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.HttpStatus; 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 = "pet", description = "Everything about your Pets") +@Tag(name = "pet", description = "Everything about your Pets") public interface PetApi { default PetApiDelegate getDelegate() { @@ -38,23 +49,22 @@ default PetApiDelegate getDelegate() { * @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, @@ -63,7 +73,7 @@ default PetApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Pet 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 getDelegate().addPet(pet); } @@ -78,29 +88,26 @@ default Pet 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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void 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 ) { getDelegate().deletePet(petId, apiKey); } @@ -115,23 +122,22 @@ default void 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, @@ -139,7 +145,7 @@ default void deletePet( ) @ResponseStatus(HttpStatus.OK) default List 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 ) { return getDelegate().findPetsByStatus(status); } @@ -156,23 +162,23 @@ default List 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, @@ -180,7 +186,7 @@ default List findPetsByStatus( ) @ResponseStatus(HttpStatus.OK) default List 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 ) { return getDelegate().findPetsByTags(tags); } @@ -196,21 +202,23 @@ default List 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, @@ -218,7 +226,7 @@ default List findPetsByTags( ) @ResponseStatus(HttpStatus.OK) default Pet 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 ) { return getDelegate().getPetById(petId); } @@ -237,25 +245,25 @@ default Pet 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, @@ -264,7 +272,7 @@ default Pet getPetById( ) @ResponseStatus(HttpStatus.OK) default Pet 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 getDelegate().updatePet(pet); } @@ -280,21 +288,18 @@ default Pet 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, @@ -302,9 +307,9 @@ default Pet updatePet( ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) default void 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 ) { getDelegate().updatePetWithForm(petId, name, status); } @@ -320,22 +325,20 @@ default void 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, @@ -344,9 +347,9 @@ default void updatePetWithForm( ) @ResponseStatus(HttpStatus.OK) default ModelApiResponse 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 ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java index d47e504a76de..f623144f3bd7 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +32,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 StoreApiDelegate getDelegate() { @@ -37,23 +48,23 @@ default StoreApiDelegate getDelegate() { * @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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void 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 ) { getDelegate().deleteOrder(orderId); } @@ -66,20 +77,20 @@ default void 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, @@ -103,18 +114,20 @@ default Map 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, @@ -122,7 +135,7 @@ default Map getInventory( ) @ResponseStatus(HttpStatus.OK) default Order 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 ) { return getDelegate().getOrderById(orderId); } @@ -137,17 +150,19 @@ default Order 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, @@ -156,7 +171,7 @@ default Order getOrderById( ) @ResponseStatus(HttpStatus.OK) default Order 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 ) { return getDelegate().placeOrder(order); } diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java index df9e6cb868a9..5bf458463c76 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -21,7 +32,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 UserApiDelegate getDelegate() { @@ -36,18 +47,18 @@ default UserApiDelegate getDelegate() { * @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, @@ -55,7 +66,7 @@ default UserApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default void 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 ) { getDelegate().createUser(user); } @@ -69,18 +80,18 @@ default void 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, @@ -88,7 +99,7 @@ default void createUser( ) @ResponseStatus(HttpStatus.OK) default void 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 ) { getDelegate().createUsersWithArrayInput(user); } @@ -102,18 +113,18 @@ default void 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, @@ -121,7 +132,7 @@ default void createUsersWithArrayInput( ) @ResponseStatus(HttpStatus.OK) default void 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 ) { getDelegate().createUsersWithListInput(user); } @@ -136,26 +147,26 @@ default void 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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void 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 ) { getDelegate().deleteUser(username); } @@ -171,18 +182,20 @@ default void 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, @@ -190,7 +203,7 @@ default void deleteUser( ) @ResponseStatus(HttpStatus.OK) default User 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 ) { return getDelegate().getUserByName(username); } @@ -206,17 +219,19 @@ default User 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, @@ -224,8 +239,8 @@ default User getUserByName( ) @ResponseStatus(HttpStatus.OK) default String 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 ) { return getDelegate().loginUser(username, password); } @@ -238,18 +253,18 @@ default String 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 @@ -272,19 +287,19 @@ default void 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, @@ -292,8 +307,8 @@ default void logoutUser( ) @ResponseStatus(HttpStatus.BAD_REQUEST) default void 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 ) { getDelegate().updateUser(username, user); } diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..2ea502c445ae --- /dev/null +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java @@ -0,0 +1,43 @@ +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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.") + .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") + ) + ) + ; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 402ea9384b80..000000000000 --- a/samples/server/petstore/springboot-delegate-no-response-entity/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 is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.") - .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-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java index 04a37147726e..24b392308f53 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java index 1012a5a2bdb3..edeb1f66019e 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java index fefd64b7bf9c..0c245c5f9f2c 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java index 5c87f13202bf..06067f7a0c84 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Pet.java @@ -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/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java index 34510604ee4d..1f94a8ef63aa 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java index c93944d5ea2e..ae9bf7482766 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/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-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index d568b26f5bef..c875e2014289 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -17,7 +17,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/UserApiDelegate.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 @@ -70,5 +70,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-delegate/README.md b/samples/server/petstore/springboot-delegate/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-delegate/README.md +++ b/samples/server/petstore/springboot-delegate/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-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index 73763c35727b..1e301c43965d 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/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-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 83a097e36e90..d16358fd8162 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 AnotherFakeApiDelegate getDelegate() { @@ -35,16 +46,17 @@ default AnotherFakeApiDelegate getDelegate() { * @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, @@ -52,7 +64,7 @@ default AnotherFakeApiDelegate getDelegate() { 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 ) { return getDelegate().call123testSpecialTags(client); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 5061839983bd..a7e9a410a2b5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -33,7 +44,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 FakeApiDelegate getDelegate() { @@ -48,22 +59,22 @@ default FakeApiDelegate getDelegate() { * @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 getDelegate().createXmlItem(xmlItem); } @@ -77,16 +88,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, @@ -94,7 +105,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 getDelegate().fakeOuterBooleanSerialize(body); } @@ -108,16 +119,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, @@ -125,7 +136,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 ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -139,16 +150,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, @@ -156,7 +167,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 getDelegate().fakeOuterNumberSerialize(body); } @@ -170,16 +181,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, @@ -187,7 +198,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 getDelegate().fakeOuterStringSerialize(body); } @@ -200,23 +211,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 ) { return getDelegate().responseObjectDifferentNames(petId); } @@ -230,22 +240,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 getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -259,23 +268,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 getDelegate().testBodyWithQueryParams(query, user); } @@ -289,16 +296,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, @@ -306,7 +314,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 ) { return getDelegate().testClientModel(client); } @@ -334,39 +342,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 getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -388,30 +396,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 getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -430,26 +438,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 getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -463,22 +471,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 getDelegate().testInlineAdditionalProperties(requestBody); } @@ -493,23 +501,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 getDelegate().testJsonFormData(param, param2); } @@ -523,22 +531,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 getDelegate().testNullable(childWithNullable); } @@ -555,24 +563,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 getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } @@ -585,16 +592,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, @@ -617,22 +624,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, @@ -640,9 +645,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 ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 50d706663cb6..ea64a6ded979 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 FakeClassnameTestApiDelegate getDelegate() { @@ -35,19 +46,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @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, @@ -55,7 +67,7 @@ default FakeClassnameTestApiDelegate getDelegate() { 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 ) { return getDelegate().testClassname(client); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 86fa601ab409..fd4b68a0469b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/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.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 { default PetApiDelegate getDelegate() { @@ -39,29 +50,26 @@ default PetApiDelegate getDelegate() { * @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 getDelegate().addPet(pet); } @@ -77,29 +85,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 getDelegate().deletePet(petId, apiKey); } @@ -114,31 +119,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 ) { return getDelegate().findPetsByStatus(status); } @@ -155,31 +158,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 ) { return getDelegate().findPetsByTags(tags); } @@ -195,28 +197,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 ) { return getDelegate().getPetById(petId); } @@ -233,31 +237,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 getDelegate().updatePet(pet); } @@ -273,30 +274,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 getDelegate().updatePetWithForm(petId, name, status); } @@ -312,22 +310,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, @@ -335,9 +331,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 ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 4c941c2018c9..0fd8220f6e74 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -21,7 +32,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 StoreApiDelegate getDelegate() { @@ -37,22 +48,22 @@ default StoreApiDelegate getDelegate() { * @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 getDelegate().deleteOrder(orderId); } @@ -65,20 +76,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, @@ -101,25 +112,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 ) { return getDelegate().getOrderById(orderId); } @@ -134,17 +147,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, @@ -152,7 +167,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 ) { return getDelegate().placeOrder(order); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 63a3458382fb..7ce48030a454 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -21,7 +32,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 UserApiDelegate getDelegate() { @@ -36,22 +47,22 @@ default UserApiDelegate getDelegate() { * @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 getDelegate().createUser(user); } @@ -65,22 +76,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 getDelegate().createUsersWithArrayInput(user); } @@ -94,22 +105,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 getDelegate().createUsersWithListInput(user); } @@ -124,22 +135,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 getDelegate().deleteUser(username); } @@ -155,25 +166,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 ) { return getDelegate().getUserByName(username); } @@ -189,25 +202,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 getDelegate().loginUser(username, password); } @@ -220,15 +235,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 @@ -250,24 +265,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 getDelegate().updateUser(username, user); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-delegate/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-delegate/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/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-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-delegate/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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index b87001aac7f3..31e31c76d622 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -50,7 +49,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index ae077abae3ef..b38454650075 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -51,7 +50,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index adc6aa622119..6dbc5a976f8a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -50,7 +49,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 944678e51561..d3a51de3677b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -99,7 +98,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; @@ -128,7 +127,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; @@ -157,7 +156,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; @@ -186,7 +185,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; @@ -215,7 +214,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -244,7 +243,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; @@ -273,7 +272,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -302,7 +301,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -323,7 +322,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; @@ -344,7 +343,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -364,7 +363,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 2a387364efff..7fddabdef062 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -50,7 +49,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 6694549de7c3..9dd3ff1328cb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -51,7 +50,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 3eab47133d9c..05382044b444 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -51,7 +50,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-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 398ac3f11065..cfdae6e98079 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -50,7 +49,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-delegate/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java index 0836af591d53..25e295524c0a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -70,7 +69,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; @@ -91,7 +90,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-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b49f686174a4..1c00064b6a78 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -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.*; @@ -59,7 +58,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-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e9174032c546..b3e5d9419b53 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -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.*; @@ -59,7 +58,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-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 1b2c47a243d6..c41d4419ea8e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -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.*; @@ -67,7 +66,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; @@ -96,7 +95,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; @@ -125,7 +124,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-delegate/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java index e92b5941eb58..c8fee69aa66d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -99,7 +98,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-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java index 90c91c5b92e6..a7ba4d616000 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -61,7 +60,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; @@ -82,7 +81,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; @@ -103,7 +102,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; @@ -124,7 +123,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; @@ -145,7 +144,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; @@ -166,7 +165,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-delegate/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java index 1d4bb17172a5..bb470bc7e678 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -67,7 +66,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-delegate/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java index 422bf293c7a5..2662307bc930 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -56,7 +55,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; @@ -77,7 +76,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-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java index 972b616f0ae4..6bfbe74a6dc3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -55,7 +54,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-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java index d8f2386fcc05..fb7904f06958 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -47,7 +46,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-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java index 3bb91573f9c7..40ff8ec66a7a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.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.*; @@ -46,7 +45,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-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 4a6f618e8fe7..1dff2c257bfd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -80,7 +79,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -108,7 +107,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -137,7 +136,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; @@ -166,7 +165,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java index 55cd4bcca4a2..dc1dedbac0f3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index e4b60450bded..e687f0393b61 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -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.*; @@ -124,7 +123,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; @@ -153,7 +152,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-delegate/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-delegate/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java index b04bd080d94a..75a4e8087634 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -213,7 +212,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; @@ -234,7 +233,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; @@ -255,7 +254,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; @@ -276,7 +275,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; @@ -297,7 +296,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-delegate/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java index 12b61bb7d25f..cbd110eb42e8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -47,7 +46,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-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 6840ba59e034..9c8f6e854bcd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index 9cc38c91886e..a8ea69739c84 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -107,7 +106,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; @@ -130,7 +129,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; @@ -151,7 +150,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; @@ -174,7 +173,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; @@ -197,7 +196,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; @@ -220,7 +219,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; @@ -241,7 +240,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; @@ -262,7 +261,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; @@ -283,7 +282,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; @@ -304,7 +303,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; @@ -325,7 +324,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; @@ -346,7 +345,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; @@ -367,7 +366,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; @@ -388,7 +387,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-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 9dd306cbb8ee..7be1b2eac616 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -51,7 +50,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; @@ -72,7 +71,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-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index c91329d1cb33..e4eab44b7f1d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -105,7 +104,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; @@ -134,7 +133,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; @@ -163,7 +162,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; @@ -192,7 +191,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 889f210352e8..2415ff54c2b9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -81,7 +80,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -110,7 +109,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java index 806347dd6fc4..3d119a068f83 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -52,7 +51,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -73,7 +72,7 @@ public Model200Response 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-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java index bd3e52b07ec4..00cb88c4359b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -54,7 +53,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; @@ -75,7 +74,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; @@ -96,7 +95,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/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java index df7cbc55a085..481a5b827b8b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.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.*; @@ -48,7 +47,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java index 9240527b772b..e40bff15af38 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -49,7 +48,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java index 7377bb6e904d..57b2c9a94b3c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -63,7 +62,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -84,7 +83,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -105,7 +104,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -126,7 +125,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java index 2991d532abb1..484edd33b702 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -60,7 +59,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java index ee4b35597d47..4d88a4075394 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -47,7 +46,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java index 8c15e7064821..f1ca2625a9b6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -102,7 +101,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; @@ -123,7 +122,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; @@ -144,7 +143,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; @@ -165,7 +164,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; @@ -186,7 +185,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; @@ -207,7 +206,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/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java index 4dd3c965c876..f7a19db1645c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -53,7 +52,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -74,7 +73,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -95,7 +94,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java index 7fd13b969a79..6579fb21c227 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -98,7 +97,7 @@ public ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -119,7 +118,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index f024e800ce47..b0e154d7502c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -118,7 +117,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; @@ -139,7 +138,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; @@ -160,7 +159,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; @@ -189,7 +188,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -219,7 +218,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; @@ -241,7 +240,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/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java index de245bc7635f..c69a47fe2d73 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -49,7 +48,7 @@ public ReadOnlyFirst 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; @@ -70,7 +69,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index d7c7e7218611..8ebeb9495243 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -55,7 +54,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -76,7 +75,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -97,7 +96,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -118,7 +117,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index 609489ab7538..9b228429721b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -48,7 +47,7 @@ public SpecialModelName(@Nullable Long $specialPropertyName) { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java index ccb0392b432e..78ac9d1892b4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index b9ddddf1d832..d77b63175001 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 1ae9051a12e3..6bcdb9356a29 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java index 9f2f53f3ba61..967a2b4dc71f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-delegate/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.*; @@ -67,7 +66,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; @@ -88,7 +87,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; @@ -109,7 +108,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; @@ -130,7 +129,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; @@ -151,7 +150,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; @@ -172,7 +171,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; @@ -193,7 +192,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; @@ -214,7 +213,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-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 1eccb0e87844..38f4ea590d81 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -143,7 +142,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -164,7 +163,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -185,7 +184,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -206,7 +205,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -235,7 +234,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -256,7 +255,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -277,7 +276,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -298,7 +297,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -319,7 +318,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -348,7 +347,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -377,7 +376,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -398,7 +397,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -419,7 +418,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -440,7 +439,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -461,7 +460,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -490,7 +489,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -519,7 +518,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -540,7 +539,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -561,7 +560,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -582,7 +581,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -603,7 +602,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -632,7 +631,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -661,7 +660,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -682,7 +681,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -703,7 +702,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -724,7 +723,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -745,7 +744,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -774,7 +773,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -803,7 +802,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 95a549621f7f..0f85b5e51c33 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.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-implicitHeaders/README.md b/samples/server/petstore/springboot-implicitHeaders/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-implicitHeaders/README.md +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index 46b9d8f6fec8..1e5ea32cf09d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index ed272236ed9b..109727169a95 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 0db11a7c3b74..aae7f89ce332 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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 + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = 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 + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNames.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = 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 + 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 = 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); @@ -427,19 +435,19 @@ 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") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "enum_header_string_array", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), - @ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } + ) + @Parameters({ + @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER), + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.GET, @@ -447,12 +455,12 @@ default ResponseEntity testEndpointParameters( consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity testEnumParameters( - @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_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); @@ -470,28 +478,28 @@ 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") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "required_boolean_group", value = "Required Boolean in group parameters", required = true, dataType = "Boolean", paramType = "header"), - @ApiImplicitParam(name = "boolean_group", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") + @Parameters({ + @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER), + @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) }) @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 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 = "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_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 = "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 + responses = { + @ApiResponse(responseCode = "200", description = "Success", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Integer.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success", response = 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-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 878513a1a30c..38082e99ec88 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index e7616b821f38..ac34fe3c7e11 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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); @@ -81,31 +89,28 @@ 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") - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") + @Parameters({ + @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.DELETE, value = PetApi.PATH_DELETE_PET ) default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId + @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -121,31 +126,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"))) { @@ -177,31 +180,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"))) { @@ -232,28 +234,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"))) { @@ -285,31 +289,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); @@ -326,30 +327,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); @@ -366,22 +364,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, @@ -389,9 +385,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-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 317a6c2dd8ed..26bb56b39575 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 19182a0968d7..8e54ff471a7e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-implicitHeaders/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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-implicitHeaders/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -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.*; @@ -48,7 +47,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-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -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.*; @@ -48,7 +47,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-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-implicitHeaders/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-implicitHeaders/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-implicitHeaders/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-implicitHeaders/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/FILES b/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/FILES index bee80ebd189f..cda3767c5400 100644 --- a/samples/server/petstore/springboot-include-http-request-context/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-include-http-request-context/.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/AdditionalPropertiesAnyTypeDto.java src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -64,5 +64,4 @@ src/main/java/org/openapitools/model/UserDto.java src/main/java/org/openapitools/model/XmlItemDto.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-include-http-request-context/README.md b/samples/server/petstore/springboot-include-http-request-context/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-include-http-request-context/README.md +++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/pom.xml b/samples/server/petstore/springboot-include-http-request-context/pom.xml index a1b3fc8f0e40..84658573bdf6 100644 --- a/samples/server/petstore/springboot-include-http-request-context/pom.xml +++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java index 87936b7a977d..5e142cf6c07a 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -5,9 +5,19 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ClientDto; -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; @@ -26,7 +36,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() { @@ -41,16 +51,17 @@ default Optional getRequest() { * @param clientDto 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 = ClientDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) - }) @RequestMapping( method = RequestMethod.PATCH, value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, @@ -58,8 +69,8 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java index 0c0afbab4ba3..593f6b003a6f 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java @@ -5,7 +5,6 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ApiResponseDto; import java.math.BigDecimal; import org.openapitools.model.ChildWithNullableDto; @@ -20,7 +19,18 @@ import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; -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; @@ -39,7 +49,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() { @@ -54,23 +64,23 @@ default Optional getRequest() { * @param xmlItemDto 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 XmlItemDto xmlItemDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "XmlItemDto", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,16 +95,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, @@ -102,8 +112,8 @@ default ResponseEntity createXmlItem( consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -118,16 +128,16 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param outerCompositeDto 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 = OuterCompositeDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterCompositeDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, @@ -135,8 +145,8 @@ default ResponseEntity fakeOuterBooleanSerialize( consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -160,16 +170,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, @@ -177,8 +187,8 @@ default ResponseEntity fakeOuterCompositeSerialize( consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -193,16 +203,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, @@ -210,8 +220,8 @@ default ResponseEntity fakeOuterNumberSerialize( consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -225,24 +235,23 @@ 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 = ResponseObjectWithDifferentFieldNamesDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNamesDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNamesDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -266,23 +275,22 @@ default ResponseEntity responseObjectD * @param fileSchemaTestClassDto (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 FileSchemaTestClassDto fileSchemaTestClassDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "FileSchemaTestClassDto", description = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -297,24 +305,22 @@ default ResponseEntity testBodyWithFileSchema( * @param userDto (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 UserDto userDto, - @ApiIgnore final HttpServletRequest servletRequest + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "UserDto", description = "", required = true) @Valid @RequestBody UserDto userDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -329,16 +335,17 @@ default ResponseEntity testBodyWithQueryParams( * @param clientDto 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 = ClientDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.PATCH, value = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -346,8 +353,8 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -385,40 +392,40 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -441,31 +448,31 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -485,27 +492,27 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -520,23 +527,23 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -552,24 +559,24 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -584,23 +591,23 @@ default ResponseEntity testJsonFormData( * @param childWithNullableDto 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 ChildWithNullableDto childWithNullableDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "ChildWithNullableDto", description = "request body", required = true) @Valid @RequestBody ChildWithNullableDto childWithNullableDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -618,25 +625,24 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -650,23 +656,23 @@ 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, produces = { "application/json" } ) default ResponseEntity testWithResultExample( - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -692,22 +698,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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, @@ -715,10 +719,10 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2ca174a50c2f..7a55657c26bc 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -5,9 +5,19 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ClientDto; -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; @@ -26,7 +36,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() { @@ -41,19 +51,20 @@ default Optional getRequest() { * @param clientDto 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 = ClientDto.class, - authorizations = { - @Authorization(value = "api_key_query") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key_query") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) - }) @RequestMapping( method = RequestMethod.PATCH, value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, @@ -61,8 +72,8 @@ default Optional getRequest() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java index 40cc10c91d3d..fbde61c110aa 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java @@ -5,12 +5,22 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ApiResponseDto; import org.springframework.lang.Nullable; import org.openapitools.model.PetDto; 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; @@ -29,7 +39,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() { @@ -45,30 +55,27 @@ 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 PetDto petDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,30 +92,27 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -124,32 +128,30 @@ 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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -181,32 +183,31 @@ 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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -237,29 +238,31 @@ 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 = PetDto.class, - authorizations = { - @Authorization(value = "api_key") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = PetDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = PetDto.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 = PetDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -291,32 +294,29 @@ 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 PetDto petDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -333,31 +333,28 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -374,22 +371,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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) - }) @RequestMapping( method = RequestMethod.POST, value = PetApi.PATH_UPLOAD_FILE, @@ -397,10 +392,10 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java index d739a21bdad8..ed27dd5bf848 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java @@ -5,10 +5,20 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.OrderDto; -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 +37,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() { @@ -43,23 +53,23 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -73,27 +83,27 @@ 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, produces = { "application/json" } ) default ResponseEntity> getInventory( - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -110,26 +120,28 @@ 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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,17 +171,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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) @RequestMapping( method = RequestMethod.POST, value = StoreApi.PATH_PLACE_ORDER, @@ -177,8 +191,8 @@ default ResponseEntity getOrderById( consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java index 3c547d623f55..c318b31fb506 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java @@ -5,10 +5,20 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.time.OffsetDateTime; import org.openapitools.model.UserDto; -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 +37,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() { @@ -42,23 +52,23 @@ default Optional getRequest() { * @param userDto 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 UserDto userDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "UserDto", description = "Created user object", required = true) @Valid @RequestBody UserDto userDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -73,23 +83,23 @@ default ResponseEntity createUser( * @param userDto 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 UserDto> userDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "UserDto", description = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -104,23 +114,23 @@ default ResponseEntity createUsersWithArrayInput( * @param userDto 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 UserDto> userDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "UserDto", description = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -136,23 +146,23 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -169,26 +179,28 @@ 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 = UserDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = UserDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = UserDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = UserDto.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, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -219,26 +231,28 @@ 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, - @ApiIgnore final HttpServletRequest servletRequest + @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, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -252,21 +266,21 @@ 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 ) default ResponseEntity logoutUser( - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -283,25 +297,25 @@ 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 UserDto userDto, - @ApiIgnore final HttpServletRequest servletRequest + @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(name = "UserDto", description = "Updated user object", required = true) @Valid @RequestBody UserDto userDto, + @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-include-http-request-context/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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index cf52b4aed0a0..963a5504f38c 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesAnyTypeDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index e4f9cdb1a71d..b93c9a10cd44 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -5,14 +5,13 @@ 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.util.List; 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesArrayDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 903de0df3da4..9948c04fcb38 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesBooleanDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 306d4eec0e10..7a35f9eaa045 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.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.util.Arrays; import java.util.HashMap; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -80,7 +79,7 @@ public AdditionalPropertiesClassDto putMapStringItem(String key, String mapStrin * @return mapString */ - @ApiModelProperty(value = "") + @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") public Map getMapString() { return mapString; @@ -109,7 +108,7 @@ public AdditionalPropertiesClassDto putMapNumberItem(String key, BigDecimal mapN * @return mapNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; @@ -138,7 +137,7 @@ public AdditionalPropertiesClassDto putMapIntegerItem(String key, Integer mapInt * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; @@ -167,7 +166,7 @@ public AdditionalPropertiesClassDto putMapBooleanItem(String key, Boolean mapBoo * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; @@ -196,7 +195,7 @@ public AdditionalPropertiesClassDto putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -225,7 +224,7 @@ public AdditionalPropertiesClassDto putMapArrayAnytypeItem(String key, List> getMapArrayAnytype() { return mapArrayAnytype; @@ -254,7 +253,7 @@ public AdditionalPropertiesClassDto putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -283,7 +282,7 @@ public AdditionalPropertiesClassDto putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -304,7 +303,7 @@ public AdditionalPropertiesClassDto 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; @@ -325,7 +324,7 @@ public AdditionalPropertiesClassDto anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -345,7 +344,7 @@ public AdditionalPropertiesClassDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index df611cb49ab5..30a80ec7e6ad 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesIntegerDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index b66b9c9eb0a3..2ae84c9d12e5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesNumberDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index d26b21fb6804..1c0211f822d6 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -5,14 +5,13 @@ 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.util.Map; 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesObjectDto 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-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 43f2eff5a64d..36a45be2a322 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesStringDto 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-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java index 99e203af7716..4d51394ed42c 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/AnimalDto.java @@ -8,13 +8,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; 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.*; @@ -63,7 +62,7 @@ public AnimalDto className(String className) { * @return className */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") public String getClassName() { return className; @@ -84,7 +83,7 @@ public AnimalDto 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-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.java index 55edd6c7eb2e..4b69e6c54cc1 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ApiResponseDto.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.*; @@ -41,7 +40,7 @@ public ApiResponseDto code(@Nullable Integer code) { * @return code */ - @ApiModelProperty(value = "") + @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") public @Nullable Integer getCode() { return code; @@ -62,7 +61,7 @@ public ApiResponseDto type(@Nullable String type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable String getType() { return type; @@ -83,7 +82,7 @@ public ApiResponseDto 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/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 6d8c6c32ffbe..d6ebdee2ba46 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfArrayOfNumberOnlyDto addArrayArrayNumberItem(List arra * @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-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 24c8477e2dc3..f67cc582f15e 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfNumberOnlyDto 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-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java index 9d02a230bbb9..429a2f78cf3a 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ArrayTestDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -56,7 +55,7 @@ public ArrayTestDto 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; @@ -85,7 +84,7 @@ public ArrayTestDto addArrayArrayOfIntegerItem(List arrayArrayOfIntegerIte * @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; @@ -114,7 +113,7 @@ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> array * @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-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java index 7f15ba3ba834..4edd7940033f 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/BigCatDto.java @@ -9,14 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; 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.CatDto; 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.*; @@ -93,7 +92,7 @@ public BigCatDto 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-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java index 76fa0b0102e7..755e26286420 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CapitalizationDto.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.*; @@ -47,7 +46,7 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") public @Nullable String getSmallCamel() { return smallCamel; @@ -68,7 +67,7 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") public @Nullable String getCapitalCamel() { return capitalCamel; @@ -89,7 +88,7 @@ public CapitalizationDto 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; @@ -110,7 +109,7 @@ public CapitalizationDto 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; @@ -131,7 +130,7 @@ public CapitalizationDto 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; @@ -152,7 +151,7 @@ public CapitalizationDto 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-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java index 7a9284f34aaa..f79ed223a79c 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CatDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -60,7 +59,7 @@ public CatDto 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-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java index 4b2480586df3..2ff40a01d9e4 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/CategoryDto.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.*; @@ -50,7 +49,7 @@ public CategoryDto 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 CategoryDto 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-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 3e1c85442952..72343d2da31f 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullableDto; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -45,7 +44,7 @@ public ChildWithNullableDto 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-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.java index 1405c5323189..2328451a18f0 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClassModelDto.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 @@ * 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") @JsonTypeName("ClassModel") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ClassModelDto { @@ -38,7 +37,7 @@ public ClassModelDto 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-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.java index 5f7a555300d6..f3371d74af20 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ClientDto.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.*; @@ -37,7 +36,7 @@ public ClientDto 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-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 192c0533e805..cb8fc7cb286c 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ContainerDefaultValueDto.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.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.*; @@ -72,7 +71,7 @@ public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -100,7 +99,7 @@ public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequ * @return nullableRequiredArray */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") public JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -129,7 +128,7 @@ public ContainerDefaultValueDto 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; @@ -158,7 +157,7 @@ public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableA * @return nullableArrayWithDefault */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") public JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java index b7a132b395d6..483f257fedc5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/DogDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -53,7 +52,7 @@ public DogDto 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-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java index 9b9538583b57..9309c9c3fd38 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -6,8 +6,6 @@ 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 java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -114,7 +113,7 @@ public EnumArraysDto 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; @@ -143,7 +142,7 @@ public EnumArraysDto 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-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java index 24bd8c9902d9..6094ebd4b9cd 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumClassDto.java @@ -7,6 +7,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-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java index ec99d5715c97..f06912058f85 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/EnumTestDto.java @@ -6,14 +6,13 @@ 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.OuterEnumDto; 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.*; @@ -202,7 +201,7 @@ public EnumTestDto 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; @@ -223,7 +222,7 @@ public EnumTestDto 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; @@ -244,7 +243,7 @@ public EnumTestDto 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; @@ -265,7 +264,7 @@ public EnumTestDto 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; @@ -286,7 +285,7 @@ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { * @return outerEnum */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") public @Nullable OuterEnumDto getOuterEnum() { return outerEnum; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.java index 080630c06d61..204027fb6ef1 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileDto.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 @@ * Must be named `File` for test. */ -@ApiModel(description = "Must be named `File` for test.") +@Schema(name = "File", description = "Must be named `File` for test.") @JsonTypeName("File") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class FileDto { @@ -38,7 +37,7 @@ public FileDto 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-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index d6eab2a8876c..315f75b14bb1 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FileSchemaTestClassDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ 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 FileSchemaTestClassDto file(@Nullable FileDto file) { * @return file */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") public @Nullable FileDto getFile() { return file; @@ -73,7 +72,7 @@ public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { * @return files */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") public List<@Valid FileDto> getFiles() { return files; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java index f36bca743590..151ecac3a6aa 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/FormatTestDto.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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public FormatTestDto 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; @@ -110,7 +109,7 @@ public FormatTestDto 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; @@ -131,7 +130,7 @@ public FormatTestDto int64(@Nullable Long int64) { * @return int64 */ - @ApiModelProperty(value = "") + @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") public @Nullable Long getInt64() { return int64; @@ -154,7 +153,7 @@ public FormatTestDto 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; @@ -177,7 +176,7 @@ public FormatTestDto _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; @@ -200,7 +199,7 @@ public FormatTestDto _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; @@ -221,7 +220,7 @@ public FormatTestDto 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; @@ -242,7 +241,7 @@ public FormatTestDto _byte(byte[] _byte) { * @return _byte */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -263,7 +262,7 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar * @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; @@ -284,7 +283,7 @@ public FormatTestDto 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; @@ -305,7 +304,7 @@ public FormatTestDto 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; @@ -326,7 +325,7 @@ public FormatTestDto 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; @@ -347,7 +346,7 @@ public FormatTestDto 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; @@ -368,7 +367,7 @@ public FormatTestDto 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-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index f269ad6a33ea..3aa0a3c9b188 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.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.*; @@ -39,7 +38,7 @@ public HasOnlyReadOnlyDto 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; @@ -60,7 +59,7 @@ public HasOnlyReadOnlyDto 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-include-http-request-context/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.java index b194fd5f1a20..8d423294883e 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ListDto.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.*; @@ -37,7 +36,7 @@ public ListDto _123List(@Nullable String _123List) { * @return _123List */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123List() { return _123List; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java index a4760272ba09..e0144d9cad38 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MapTestDto.java @@ -6,8 +6,6 @@ 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 java.util.HashMap; import java.util.Map; import org.springframework.lang.Nullable; @@ -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.*; @@ -93,7 +92,7 @@ public MapTestDto putMapMapOfStringItem(String key, Map mapMapOf * @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; @@ -122,7 +121,7 @@ public MapTestDto putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringIt * @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; @@ -151,7 +150,7 @@ public MapTestDto 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; @@ -180,7 +179,7 @@ public MapTestDto putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 17b19984cebe..8757e83c16d5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -70,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -99,7 +98,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto putMapItem(String key, Ani * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/Model200ResponseDto.java index d33f33ac5b7c..1fcd887cb0bc 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/Model200ResponseDto.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200ResponseDto { @@ -40,7 +39,7 @@ public Model200ResponseDto name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200ResponseDto 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-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java index a183a9564f05..ea9d9f66ba86 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NameDto.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @JsonTypeName("Name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class NameDto { @@ -55,7 +54,7 @@ public NameDto name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -76,7 +75,7 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -97,7 +96,7 @@ public NameDto property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -118,7 +117,7 @@ public NameDto _123Number(@Nullable Integer _123Number) { * @return _123Number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123Number() { return _123Number; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index 6be04c42bc2d..4f0869153de5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NullableMapPropertyDto.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.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -51,7 +50,7 @@ public NullableMapPropertyDto putLanguageValuesItem(String key, String languageV * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NumberOnlyDto.java index e08766e110d9..af970011d469 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -38,7 +37,7 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OrderDto.java index cf6cd9e8aba1..419b5335e857 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OrderDto.java @@ -6,8 +6,6 @@ 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 java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; @@ -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.*; @@ -88,7 +87,7 @@ public OrderDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -109,7 +108,7 @@ public OrderDto petId(@Nullable Long petId) { * @return petId */ - @ApiModelProperty(value = "") + @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") public @Nullable Long getPetId() { return petId; @@ -130,7 +129,7 @@ public OrderDto quantity(@Nullable Integer quantity) { * @return quantity */ - @ApiModelProperty(value = "") + @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") public @Nullable Integer getQuantity() { return quantity; @@ -151,7 +150,7 @@ public OrderDto 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; @@ -172,7 +171,7 @@ public OrderDto 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; @@ -193,7 +192,7 @@ public OrderDto 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/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterCompositeDto.java index 7473efd3ef7e..892ac0abe59d 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -42,7 +41,7 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -63,7 +62,7 @@ public OuterCompositeDto myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -84,7 +83,7 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterEnumDto.java index e00345898bb9..7a02d8db757b 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterEnumDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -7,6 +7,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-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 4128d2984145..80ffbc926820 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -108,7 +107,7 @@ public ParentWithNullableDto nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java index 28a51738ca2d..b1c6d72d3006 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/PetDto.java @@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -21,6 +19,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -108,7 +107,7 @@ public PetDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -129,7 +128,7 @@ public PetDto category(@Nullable CategoryDto category) { * @return category */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") public @Nullable CategoryDto getCategory() { return category; @@ -150,7 +149,7 @@ public PetDto 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; @@ -179,7 +178,7 @@ public PetDto addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -209,7 +208,7 @@ public PetDto addTagsItem(TagDto tagsItem) { * @return tags */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") public List<@Valid TagDto> getTags() { return tags; @@ -231,7 +230,7 @@ public PetDto 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/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 474eaf87c360..6df88518b628 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReadOnlyFirstDto.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.*; @@ -39,7 +38,7 @@ public ReadOnlyFirstDto 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; @@ -60,7 +59,7 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index c9bb2b32de7f..333a898ed88d 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.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.*; @@ -43,7 +42,7 @@ public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable Str * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -64,7 +63,7 @@ public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nulla * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -85,7 +84,7 @@ public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullabl * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -106,7 +105,7 @@ public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReturnDto.java index d97190139983..20e809a0f081 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/ReturnDto.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ReturnDto { @@ -38,7 +37,7 @@ public ReturnDto _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 742e6fbb25ed..3076794c1652 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/SpecialModelNameDto.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.*; @@ -37,7 +36,7 @@ public class SpecialModelNameDto { * @return $SpecialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $SpecialPropertyName; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TagDto.java index 821043b3e6e9..320ef572224e 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TagDto.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.*; @@ -39,7 +38,7 @@ public TagDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -60,7 +59,7 @@ public TagDto 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-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index df7cfb007dd3..9fae3543ea0b 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderDefaultDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -65,7 +64,7 @@ public TypeHolderDefaultDto stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -86,7 +85,7 @@ public TypeHolderDefaultDto numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -107,7 +106,7 @@ public TypeHolderDefaultDto integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -128,7 +127,7 @@ public TypeHolderDefaultDto boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -157,7 +156,7 @@ public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 0cbea4f3b99b..2f3a861e5588 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/TypeHolderExampleDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -68,7 +67,7 @@ public TypeHolderExampleDto stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -89,7 +88,7 @@ public TypeHolderExampleDto numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -110,7 +109,7 @@ public TypeHolderExampleDto floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -131,7 +130,7 @@ public TypeHolderExampleDto integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -152,7 +151,7 @@ public TypeHolderExampleDto boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -181,7 +180,7 @@ public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/UserDto.java index 689790d2b18a..43e3e24ec599 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/UserDto.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.*; @@ -51,7 +50,7 @@ public UserDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -72,7 +71,7 @@ public UserDto username(@Nullable String username) { * @return username */ - @ApiModelProperty(value = "") + @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") public @Nullable String getUsername() { return username; @@ -93,7 +92,7 @@ public UserDto firstName(@Nullable String firstName) { * @return firstName */ - @ApiModelProperty(value = "") + @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") public @Nullable String getFirstName() { return firstName; @@ -114,7 +113,7 @@ public UserDto lastName(@Nullable String lastName) { * @return lastName */ - @ApiModelProperty(value = "") + @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") public @Nullable String getLastName() { return lastName; @@ -135,7 +134,7 @@ public UserDto email(@Nullable String email) { * @return email */ - @ApiModelProperty(value = "") + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") public @Nullable String getEmail() { return email; @@ -156,7 +155,7 @@ public UserDto password(@Nullable String password) { * @return password */ - @ApiModelProperty(value = "") + @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") public @Nullable String getPassword() { return password; @@ -177,7 +176,7 @@ public UserDto phone(@Nullable String phone) { * @return phone */ - @ApiModelProperty(value = "") + @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") public @Nullable String getPhone() { return phone; @@ -198,7 +197,7 @@ public UserDto 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-include-http-request-context/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/XmlItemDto.java index 8b9f4634ab67..145ec198bcef 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/model/XmlItemDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,7 @@ public XmlItemDto attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -127,7 +126,7 @@ public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -148,7 +147,7 @@ public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -169,7 +168,7 @@ public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -198,7 +197,7 @@ public XmlItemDto addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -219,7 +218,7 @@ public XmlItemDto nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -240,7 +239,7 @@ public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -261,7 +260,7 @@ public XmlItemDto nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -282,7 +281,7 @@ public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -311,7 +310,7 @@ public XmlItemDto addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -340,7 +339,7 @@ public XmlItemDto addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -361,7 +360,7 @@ public XmlItemDto prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -382,7 +381,7 @@ public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -403,7 +402,7 @@ public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -424,7 +423,7 @@ public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -453,7 +452,7 @@ public XmlItemDto addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -482,7 +481,7 @@ public XmlItemDto addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -503,7 +502,7 @@ public XmlItemDto namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -524,7 +523,7 @@ public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -545,7 +544,7 @@ public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -566,7 +565,7 @@ public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -595,7 +594,7 @@ public XmlItemDto addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -624,7 +623,7 @@ public XmlItemDto addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -645,7 +644,7 @@ public XmlItemDto prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -666,7 +665,7 @@ public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -687,7 +686,7 @@ public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -708,7 +707,7 @@ public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -737,7 +736,7 @@ public XmlItemDto addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -766,7 +765,7 @@ public XmlItemDto addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive-noResponseEntity/.openapi-generator/FILES index 93297148e9b7..b880a7142eea 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/.openapi-generator/FILES @@ -69,5 +69,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-reactive-noResponseEntity/README.md b/samples/server/petstore/springboot-reactive-noResponseEntity/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/README.md +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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-reactive-noResponseEntity/pom.xml b/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml index 0e8d5c957d03..c9e98b06be19 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/pom.xml +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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-webflux-ui + ${springdoc.version} diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index 5a7f072c3a40..f3932dd4c635 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.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 = "$another-fake?", description = "the $another-fake? API") +@Tag(name = "$another-fake?", description = "the $another-fake? API") public interface AnotherFakeApi { default AnotherFakeApiDelegate getDelegate() { @@ -38,16 +49,17 @@ default AnotherFakeApiDelegate getDelegate() { * @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 AnotherFakeApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Mono call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().call123testSpecialTags(client); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiController.java index ad099eac3a36..8390087c6f5e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; @@ -25,7 +24,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 1562cf5814f5..e3084f0b6509 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -36,7 +47,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 FakeApiDelegate getDelegate() { @@ -51,15 +62,15 @@ default FakeApiDelegate getDelegate() { * @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, @@ -67,7 +78,7 @@ default FakeApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Mono createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem ) { return getDelegate().createXmlItem(xmlItem); } @@ -81,16 +92,16 @@ default Mono 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 Mono createXmlItem( ) @ResponseStatus(HttpStatus.OK) default Mono fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -113,16 +124,16 @@ default Mono 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 Mono fakeOuterBooleanSerialize( ) @ResponseStatus(HttpStatus.OK) default Mono fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -145,16 +156,16 @@ default Mono 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, @@ -163,7 +174,7 @@ default Mono fakeOuterCompositeSerialize( ) @ResponseStatus(HttpStatus.OK) default Mono fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -177,16 +188,16 @@ default Mono 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, @@ -195,7 +206,7 @@ default Mono fakeOuterNumberSerialize( ) @ResponseStatus(HttpStatus.OK) default Mono fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterStringSerialize(body); } @@ -208,16 +219,15 @@ default Mono 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, @@ -225,7 +235,7 @@ default Mono fakeOuterStringSerialize( ) @ResponseStatus(HttpStatus.OK) default Mono 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 ) { return getDelegate().responseObjectDifferentNames(petId); } @@ -239,15 +249,14 @@ default Mono responseObjectDifferentNames * @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, @@ -255,7 +264,7 @@ default Mono responseObjectDifferentNames ) @ResponseStatus(HttpStatus.OK) default Mono testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass ) { return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -269,15 +278,13 @@ default Mono 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, @@ -285,8 +292,8 @@ default Mono testBodyWithFileSchema( ) @ResponseStatus(HttpStatus.OK) default Mono testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody Mono 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 Mono user ) { return getDelegate().testBodyWithQueryParams(query, user); } @@ -300,16 +307,17 @@ default Mono 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, @@ -318,7 +326,7 @@ default Mono testBodyWithQueryParams( ) @ResponseStatus(HttpStatus.OK) default Mono testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().testClientModel(client); } @@ -346,19 +354,19 @@ default Mono 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, @@ -366,20 +374,20 @@ default Mono testClientModel( ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono testEndpointParameters( - @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Part binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback + @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) Part binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -401,16 +409,16 @@ default Mono 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, @@ -418,14 +426,14 @@ default Mono testEndpointParameters( ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono 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 @RequestPart(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 @RequestPart(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -444,27 +452,27 @@ default Mono 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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono 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 getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -478,15 +486,15 @@ default Mono 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, @@ -494,7 +502,7 @@ default Mono testGroupParameters( ) @ResponseStatus(HttpStatus.OK) default Mono testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Mono> requestBody ) { return getDelegate().testInlineAdditionalProperties(requestBody); } @@ -509,15 +517,15 @@ default Mono 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, @@ -525,8 +533,8 @@ default Mono testInlineAdditionalProperties( ) @ResponseStatus(HttpStatus.OK) default Mono testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2 ) { return getDelegate().testJsonFormData(param, param2); } @@ -540,15 +548,15 @@ default Mono 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, @@ -556,7 +564,7 @@ default Mono testJsonFormData( ) @ResponseStatus(HttpStatus.OK) default Mono testNullable( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono childWithNullable + @Parameter(name = "ChildWithNullable", description = "request body", required = true) @Valid @RequestBody Mono childWithNullable ) { return getDelegate().testNullable(childWithNullable); } @@ -573,25 +581,24 @@ default Mono 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 ) @ResponseStatus(HttpStatus.OK) default Mono 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 getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } @@ -604,16 +611,16 @@ default Mono 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, @@ -637,22 +644,20 @@ default Mono 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, @@ -661,9 +666,9 @@ default Mono testWithResultExample( ) @ResponseStatus(HttpStatus.OK) default Mono 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) Part requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(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) Part requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiController.java index 26840ffb0ead..ed34b005d583 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; @@ -9,6 +8,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; @@ -37,7 +37,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index dd5597fcd632..2cd77ceadb0c 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.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 = "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 FakeClassnameTestApiDelegate getDelegate() { @@ -38,19 +49,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @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 FakeClassnameTestApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Mono testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().testClassname(client); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 1612ebc7c61d..a450459f93f7 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; @@ -25,7 +24,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index 8f716e9cc229..8f6f35d07562 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -26,7 +37,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 PetApiDelegate getDelegate() { @@ -42,22 +53,19 @@ default PetApiDelegate getDelegate() { * @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, @@ -65,7 +73,7 @@ default PetApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Mono addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet ) { return getDelegate().addPet(pet); } @@ -81,30 +89,27 @@ default Mono 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 ) @ResponseStatus(HttpStatus.OK) default Mono 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 getDelegate().deletePet(petId, apiKey); } @@ -119,24 +124,22 @@ default Mono 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, @@ -144,7 +147,7 @@ default Mono deletePet( ) @ResponseStatus(HttpStatus.OK) default Flux 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 ) { return getDelegate().findPetsByStatus(status); } @@ -161,24 +164,23 @@ default Flux 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, @@ -186,7 +188,7 @@ default Flux findPetsByStatus( ) @ResponseStatus(HttpStatus.OK) default Flux 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 ) { return getDelegate().findPetsByTags(tags); } @@ -202,21 +204,23 @@ default Flux 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, @@ -224,7 +228,7 @@ default Flux findPetsByTags( ) @ResponseStatus(HttpStatus.OK) default Mono 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 ) { return getDelegate().getPetById(petId); } @@ -241,24 +245,21 @@ default Mono 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, @@ -266,7 +267,7 @@ default Mono getPetById( ) @ResponseStatus(HttpStatus.OK) default Mono updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet ) { return getDelegate().updatePet(pet); } @@ -282,21 +283,18 @@ default Mono 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, @@ -304,9 +302,9 @@ default Mono updatePet( ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) default Mono 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 @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(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 @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status ) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -322,22 +320,20 @@ default Mono 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, @@ -346,9 +342,9 @@ default Mono updatePetWithForm( ) @ResponseStatus(HttpStatus.OK) default Mono uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part 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 @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Part file ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiController.java index 0b2c329de38b..2bd66cb09d89 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import org.openapitools.model.Pet; import java.util.Set; @@ -27,7 +27,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index 1f6f9e741638..cd09e26248d1 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.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 = "store", description = "Access to Petstore orders") +@Tag(name = "store", description = "Access to Petstore orders") public interface StoreApi { default StoreApiDelegate getDelegate() { @@ -40,23 +51,23 @@ default StoreApiDelegate getDelegate() { * @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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono 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 getDelegate().deleteOrder(orderId); } @@ -69,20 +80,20 @@ default Mono 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, @@ -106,18 +117,20 @@ default Mono> 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, @@ -125,7 +138,7 @@ default Mono> getInventory( ) @ResponseStatus(HttpStatus.OK) default Mono 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 ) { return getDelegate().getOrderById(orderId); } @@ -140,17 +153,19 @@ default Mono 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, @@ -159,7 +174,7 @@ default Mono getOrderById( ) @ResponseStatus(HttpStatus.OK) default Mono placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order ) { return getDelegate().placeOrder(order); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiController.java index ce43f86dbf2f..916135578c6e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.Order; @@ -26,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index a146595ef2b9..19e91bbcdb30 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.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 = "user", description = "Operations about user") +@Tag(name = "user", description = "Operations about user") public interface UserApi { default UserApiDelegate getDelegate() { @@ -39,15 +50,15 @@ default UserApiDelegate getDelegate() { * @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, @@ -55,7 +66,7 @@ default UserApiDelegate getDelegate() { ) @ResponseStatus(HttpStatus.OK) default Mono createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody Mono user ) { return getDelegate().createUser(user); } @@ -69,15 +80,15 @@ default Mono 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, @@ -85,7 +96,7 @@ default Mono createUser( ) @ResponseStatus(HttpStatus.OK) default Mono createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody Flux user ) { return getDelegate().createUsersWithArrayInput(user); } @@ -99,15 +110,15 @@ default Mono 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, @@ -115,7 +126,7 @@ default Mono createUsersWithArrayInput( ) @ResponseStatus(HttpStatus.OK) default Mono createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody Flux user ) { return getDelegate().createUsersWithListInput(user); } @@ -130,23 +141,23 @@ default Mono 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 ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono 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 getDelegate().deleteUser(username); } @@ -162,18 +173,20 @@ default Mono 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, @@ -181,7 +194,7 @@ default Mono deleteUser( ) @ResponseStatus(HttpStatus.OK) default Mono 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 ) { return getDelegate().getUserByName(username); } @@ -197,17 +210,19 @@ default Mono 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, @@ -215,8 +230,8 @@ default Mono getUserByName( ) @ResponseStatus(HttpStatus.OK) default Mono 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 getDelegate().loginUser(username, password); } @@ -229,15 +244,15 @@ default Mono 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 @@ -260,16 +275,16 @@ default Mono 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, @@ -277,8 +292,8 @@ default Mono logoutUser( ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono 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 Mono user ) { return getDelegate().updateUser(username, user); } diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiController.java index eda8744dbdc0..f0b76e23a343 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.time.OffsetDateTime; import org.openapitools.model.User; @@ -26,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @RestController @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HomeController.java index f8f80d182c2d..cf658246a9de 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/configuration/HomeController.java @@ -18,14 +18,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"; - } - @Bean RouterFunction index() { return route( diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -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.*; @@ -48,7 +47,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -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.*; @@ -48,7 +47,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index 93297148e9b7..b880a7142eea 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -69,5 +69,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-reactive/README.md b/samples/server/petstore/springboot-reactive/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-reactive/README.md +++ b/samples/server/petstore/springboot-reactive/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-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index ba87915a9d58..4bf0fd0571d8 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/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-webflux-ui + ${springdoc.version} diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 6e0666593256..038f88d9a558 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -5,9 +5,19 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; 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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,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 AnotherFakeApiDelegate getDelegate() { @@ -40,16 +50,17 @@ default AnotherFakeApiDelegate getDelegate() { * @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, @@ -57,8 +68,8 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) default Mono> call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().call123testSpecialTags(client, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c9afaab792d8..059f1785566c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; @@ -26,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index f2c83344313c..8d44a14a1e86 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 1a6443fc888b..4fd67692f029 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -5,7 +5,6 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; @@ -20,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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -38,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 FakeApiDelegate getDelegate() { @@ -53,23 +63,23 @@ default FakeApiDelegate getDelegate() { * @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 Mono> createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createXmlItem(xmlItem, exchange); } @@ -83,16 +93,16 @@ default Mono> 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, @@ -100,8 +110,8 @@ default Mono> createXmlItem( consumes = { "application/json" } ) default Mono> fakeOuterBooleanSerialize( - @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); } @@ -115,16 +125,16 @@ default Mono> 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, @@ -132,8 +142,8 @@ default Mono> fakeOuterBooleanSerialize( consumes = { "application/json" } ) default Mono> fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite, exchange); } @@ -147,16 +157,16 @@ default Mono> 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, @@ -164,8 +174,8 @@ default Mono> fakeOuterCompositeSerialize( consumes = { "application/json" } ) default Mono> fakeOuterNumberSerialize( - @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterNumberSerialize(body, exchange); } @@ -179,16 +189,16 @@ default Mono> 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, @@ -196,8 +206,8 @@ default Mono> fakeOuterNumberSerialize( consumes = { "application/json" } ) default Mono> fakeOuterStringSerialize( - @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().fakeOuterStringSerialize(body, exchange); } @@ -210,24 +220,23 @@ default Mono> 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 Mono> responseObjectDifferentNames( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().responseObjectDifferentNames(petId, exchange); } @@ -241,23 +250,22 @@ default Mono> responseObje * @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 Mono> testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testBodyWithFileSchema(fileSchemaTestClass, exchange); } @@ -271,24 +279,22 @@ default Mono> 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 Mono> testBodyWithQueryParams( - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, - @ApiIgnore final ServerWebExchange exchange + @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 Mono user, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testBodyWithQueryParams(query, user, exchange); } @@ -302,16 +308,17 @@ default Mono> 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, @@ -319,8 +326,8 @@ default Mono> testBodyWithQueryParams( consumes = { "application/json" } ) default Mono> testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testClientModel(client, exchange); } @@ -348,40 +355,40 @@ default Mono> 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 Mono> testEndpointParameters( - @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, - @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Part binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, + @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, + @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, + @Parameter(name = "int64", description = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, + @Parameter(name = "float", description = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, + @Parameter(name = "string", description = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, + @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) Part binary, + @Parameter(name = "date", description = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @Parameter(name = "password", description = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, + @Parameter(name = "callback", description = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); } @@ -403,31 +410,31 @@ default Mono> 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 Mono> 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 @RequestPart(value = "enum_form_string", required = false) String enumFormString, - @ApiIgnore final ServerWebExchange exchange + @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 @RequestPart(value = "enum_form_string", required = false) String enumFormString, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); } @@ -446,27 +453,27 @@ default Mono> 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 Mono> 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, - @ApiIgnore final ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } @@ -480,23 +487,23 @@ default Mono> 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 Mono> testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Mono> requestBody, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testInlineAdditionalProperties(requestBody, exchange); } @@ -511,24 +518,24 @@ default Mono> 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 Mono> testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "param", description = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testJsonFormData(param, param2, exchange); } @@ -542,23 +549,23 @@ default Mono> 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 Mono> testNullable( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono childWithNullable, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "ChildWithNullable", description = "request body", required = true) @Valid @RequestBody Mono childWithNullable, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testNullable(childWithNullable, exchange); } @@ -575,25 +582,24 @@ default Mono> 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 Mono> 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, - @ApiIgnore final ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context, exchange); } @@ -606,23 +612,23 @@ default Mono> 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, produces = { "application/json" } ) default Mono> testWithResultExample( - @ApiIgnore final ServerWebExchange exchange + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testWithResultExample(exchange); } @@ -638,22 +644,20 @@ default Mono> 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, @@ -661,10 +665,10 @@ default Mono> testWithResultExample( consumes = { "multipart/form-data" } ) default Mono> 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) Part requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiIgnore final ServerWebExchange exchange + @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) Part requiredFile, + @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java index cb1695a319e1..39f9919768ee 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; @@ -9,6 +8,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.ResponseObjectWithDifferentFieldNames; @@ -38,7 +38,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index dea9f39ee65d..1eae4fb533ec 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.math.BigDecimal; import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ae34c5b6bd6b..ddde9223bbc0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -5,9 +5,19 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; 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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -25,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 FakeClassnameTestApiDelegate getDelegate() { @@ -40,19 +50,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @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, @@ -60,8 +71,8 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) default Mono> testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testClassname(client, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index f98a29c1d782..d147735fde1b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; @@ -26,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 0b6e1c8ac6bf..f9bce3658be9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.Client; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 113748a6edd3..0c870053f110 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -5,12 +5,22 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; 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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -28,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 PetApiDelegate getDelegate() { @@ -44,30 +54,27 @@ default PetApiDelegate getDelegate() { * @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 Mono> addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().addPet(pet, exchange); } @@ -83,30 +90,27 @@ default Mono> 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 Mono> deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey, - @ApiIgnore final ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deletePet(petId, apiKey, exchange); } @@ -121,32 +125,30 @@ default Mono> 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 Mono>> 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 ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().findPetsByStatus(status, exchange); } @@ -163,32 +165,31 @@ default Mono>> 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 Mono>> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, - @ApiIgnore final ServerWebExchange exchange + @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().findPetsByTags(tags, exchange); } @@ -204,29 +205,31 @@ default Mono>> 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 Mono> getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getPetById(petId, exchange); } @@ -243,32 +246,29 @@ default Mono> 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 Mono> updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updatePet(pet, exchange); } @@ -284,31 +284,28 @@ default Mono> 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 Mono> 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 @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, - @ApiIgnore final ServerWebExchange exchange + @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 @RequestPart(value = "name", required = false) String name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updatePetWithForm(petId, name, status, exchange); } @@ -324,22 +321,20 @@ default Mono> 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, @@ -347,10 +342,10 @@ default Mono> updatePetWithForm( consumes = { "multipart/form-data" } ) default Mono> uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part file, - @ApiIgnore final ServerWebExchange exchange + @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 @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Part file, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java index 4b6a806bf6df..afade04fbbc8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java @@ -1,7 +1,7 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import org.openapitools.model.Pet; import java.util.Set; @@ -28,7 +28,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index a863d5b779af..dcb21a65031c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import org.openapitools.model.ModelApiResponse; import org.springframework.lang.Nullable; import org.openapitools.model.Pet; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index a7640c326933..7e58d889c7e1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -5,10 +5,20 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; 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.*; @@ -26,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 StoreApiDelegate getDelegate() { @@ -42,23 +52,23 @@ default StoreApiDelegate getDelegate() { * @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 Mono> deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deleteOrder(orderId, exchange); } @@ -71,27 +81,27 @@ default Mono> 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, produces = { "application/json" } ) default Mono>> getInventory( - @ApiIgnore final ServerWebExchange exchange + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getInventory(exchange); } @@ -107,26 +117,28 @@ default Mono>> 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 Mono> getOrderById( - @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, - @ApiIgnore final ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getOrderById(orderId, exchange); } @@ -141,17 +153,19 @@ default Mono> 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, @@ -159,8 +173,8 @@ default Mono> getOrderById( consumes = { "application/json" } ) default Mono> placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().placeOrder(order, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java index 72b8085628cf..08c70e47712d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.Order; @@ -27,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 33abf78d229b..f407f95832f8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; import org.openapitools.model.Order; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 808cc7970b6a..352121d8f1dd 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -5,10 +5,20 @@ */ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; 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.*; @@ -26,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 UserApiDelegate getDelegate() { @@ -41,23 +51,23 @@ default UserApiDelegate getDelegate() { * @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 Mono> createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody Mono user, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUser(user, exchange); } @@ -71,23 +81,23 @@ default Mono> 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 Mono> createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody Flux user, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUsersWithArrayInput(user, exchange); } @@ -101,23 +111,23 @@ default Mono> 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 Mono> createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody Flux user, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().createUsersWithListInput(user, exchange); } @@ -132,23 +142,23 @@ default Mono> 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 Mono> deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().deleteUser(username, exchange); } @@ -164,26 +174,28 @@ default Mono> 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 Mono> getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, - @ApiIgnore final ServerWebExchange exchange + @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getUserByName(username, exchange); } @@ -199,26 +211,28 @@ default Mono> 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 Mono> 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, - @ApiIgnore final ServerWebExchange exchange + @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, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().loginUser(username, password, exchange); } @@ -231,21 +245,21 @@ default Mono> 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 ) default Mono> logoutUser( - @ApiIgnore final ServerWebExchange exchange + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().logoutUser(exchange); } @@ -261,25 +275,25 @@ default Mono> 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 Mono> updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, - @ApiIgnore final ServerWebExchange exchange + @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 Mono user, + @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().updateUser(username, user, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java index 083c32a27930..261a67cba26f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.time.OffsetDateTime; import org.openapitools.model.User; @@ -27,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index f95ba8e4a7ea..443f533051b2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,5 @@ package org.openapitools.api; -import springfox.documentation.annotations.ApiIgnore; import java.time.OffsetDateTime; import org.openapitools.model.User; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index f8f80d182c2d..cf658246a9de 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -18,14 +18,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"; - } - @Bean RouterFunction index() { return route( diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 2bb0e8bb4150..3d7389bec4c9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,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; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java index f1ec67972a65..24e08237647d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,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-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -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.*; @@ -48,7 +47,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-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -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.*; @@ -48,7 +47,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-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java index 77dff7865947..f94bf89317f0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,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-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java index 6e6ab302f94f..9612eb31c5c4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,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-reactive/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-reactive/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java index 1851fdfee2bb..01cc7eb0462e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,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-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-reactive/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 54bb741071ef..2386137fecb5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-reactive/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-reactive/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java index bcc5f2a798bc..c7d431471e4d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-reactive/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java index a812b63cc916..7c079520417f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index b7ce9bec70a6..5f1acaaec695 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,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; @@ -127,7 +126,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; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,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/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index 79bbf112b64c..064c39c2d87e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(@Nullable String * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(@Nullable * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(@Nullable S * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(@Nullable St * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 81c0eda3fd90..d4ab4718139c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-reactive/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 4bfb01e8abcd..858ed5d043b1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-reactive/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES index ade930debbfb..39755ed7c2e0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/java/org/openapitools/api/VersioningApi.java src/main/java/org/openapitools/api/VersioningApiDelegate.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 @@ -66,5 +66,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-spring-pageable-delegatePattern-without-j8/README.md b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/README.md +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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-spring-pageable-delegatePattern-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml index 174e4b048273..4a2f155e31a1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9623b89cec76..9e3a8b563ccd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 AnotherFakeApiDelegate getDelegate() { @@ -35,16 +46,17 @@ default AnotherFakeApiDelegate getDelegate() { * @param body 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, @@ -52,7 +64,7 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e27e2fc20ea9..059f1785566c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 09ae50cd9f8a..ffa8a2e29dc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -17,7 +17,18 @@ import org.openapitools.model.OuterComposite; 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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -31,7 +42,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 FakeApiDelegate getDelegate() { @@ -46,22 +57,22 @@ default FakeApiDelegate getDelegate() { * @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 getDelegate().createXmlItem(xmlItem); } @@ -75,23 +86,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterBooleanSerialize(body); } @@ -105,23 +116,23 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param body 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -135,23 +146,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterNumberSerialize(body); } @@ -165,23 +176,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterStringSerialize(body); } @@ -195,22 +206,21 @@ default ResponseEntity fakeOuterStringSerialize( * @param body (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 body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return getDelegate().testBodyWithFileSchema(body); } @@ -224,23 +234,21 @@ default ResponseEntity testBodyWithFileSchema( * @param body (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 body + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -254,16 +262,17 @@ default ResponseEntity testBodyWithQueryParams( * @param body 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 + 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 = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -271,7 +280,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClientModel(body); } @@ -299,39 +308,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") - } + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "http_basic_test") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @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 getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -353,30 +362,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" + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "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 getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -395,26 +404,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 getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -427,22 +436,21 @@ default ResponseEntity testGroupParameters( * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testInlineAdditionalProperties", + summary = "test inline additionalProperties", 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 param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return getDelegate().testInlineAdditionalProperties(param); } @@ -456,23 +464,22 @@ default ResponseEntity testInlineAdditionalProperties( * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testJsonFormData", + summary = "test json serialization of form data", 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 getDelegate().testJsonFormData(param, param2); } @@ -490,25 +497,24 @@ default ResponseEntity testJsonFormData( * @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 = "ioutil", required = true) List ioutil, - @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 = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @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 getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -523,22 +529,19 @@ default ResponseEntity testQueryParameterCollectionFormat( * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFileWithRequiredFile", + summary = "uploads an image (required)", 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, @@ -546,9 +549,9 @@ default ResponseEntity testQueryParameterCollectionFormat( 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 ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 726b17779f18..1947c8e3b1a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -7,6 +7,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -35,7 +36,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 94d649b96b2c..95ab6c2b1c43 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 FakeClassnameTestApiDelegate getDelegate() { @@ -35,19 +46,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body 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, @@ -55,7 +67,7 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 21e28fe8b213..d147735fde1b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 1dc6bd20193f..54d627166897 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.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.*; @@ -24,7 +35,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 PetApiDelegate getDelegate() { @@ -39,29 +50,25 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation( + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().addPet(body); } @@ -76,29 +83,25 @@ default ResponseEntity addPet( * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", 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 getDelegate().deletePet(petId, apiKey); } @@ -113,32 +116,30 @@ 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, - @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 ) { return getDelegate().findPetsByStatus(status, pageable); } @@ -156,33 +157,32 @@ 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 = "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 = 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) List tags, - @ApiParam(value = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.") @RequestHeader(value = "size", required = false) @Nullable String size, - @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, + @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, + @ParameterObject final Pageable pageable ) { return getDelegate().findPetsByTags(tags, size, pageable); } @@ -198,28 +198,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 ) { return getDelegate().getPetById(petId); } @@ -232,31 +234,28 @@ default ResponseEntity getPetById( * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "listAllPets", + summary = "List all pets", tags = { "pet" }, - value = "List all pets", - nickname = "listAllPets", - notes = "", - 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_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) default ResponseEntity> listAllPets( - @ApiIgnore final Pageable pageable + @ParameterObject final Pageable pageable ) { return getDelegate().listAllPets(pageable); } @@ -272,31 +271,27 @@ default ResponseEntity> listAllPets( * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation( + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().updatePet(body); } @@ -311,30 +306,26 @@ 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", 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 getDelegate().updatePetWithForm(petId, name, status); } @@ -349,22 +340,19 @@ default ResponseEntity updatePetWithForm( * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFile", + summary = "uploads an image", 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, @@ -372,9 +360,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 ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java index 665635623373..02e80c3d8ded 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,9 @@ 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; @@ -28,7 +29,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index f5c35b4e1796..0f4f40806bc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,9 +1,9 @@ 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 org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index c374a22d9e81..e7a7686af636 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -21,7 +32,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 StoreApiDelegate getDelegate() { @@ -37,22 +48,22 @@ default StoreApiDelegate getDelegate() { * @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 getDelegate().deleteOrder(orderId); } @@ -65,20 +76,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, @@ -101,25 +112,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 ) { return getDelegate().getOrderById(orderId); } @@ -133,24 +146,25 @@ 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", 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, produces = { "application/xml", "application/json" } ) default 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 ) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index e9e29a41b4f9..08c70e47712d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 21e1acd37aaf..8a0af0374d36 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -21,7 +32,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 UserApiDelegate getDelegate() { @@ -36,21 +47,21 @@ default UserApiDelegate getDelegate() { * @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" }, - 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 ) default 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 ) { return getDelegate().createUser(body); } @@ -63,21 +74,20 @@ default 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" }, - 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 ) default 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 ) { return getDelegate().createUsersWithArrayInput(body); } @@ -90,21 +100,20 @@ default 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" }, - 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 ) default 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 ) { return getDelegate().createUsersWithListInput(body); } @@ -119,22 +128,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 getDelegate().deleteUser(username); } @@ -149,25 +158,26 @@ 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", 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 ) { return getDelegate().getUserByName(username); } @@ -182,25 +192,26 @@ 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", 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 getDelegate().loginUser(username, password); } @@ -212,15 +223,14 @@ default ResponseEntity loginUser( * * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", 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 @@ -242,23 +252,23 @@ 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 ) 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 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 ) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 463838f10ac4..261a67cba26f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index f512a47cb7e9..38111ea1d9b7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; -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.*; @@ -20,7 +31,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Validated -@Api(value = "versioning", description = "the versioning API") +@Tag(name = "versioning", description = "the versioning API") public interface VersioningApi { default VersioningApiDelegate getDelegate() { @@ -36,16 +47,15 @@ default VersioningApiDelegate getDelegate() { * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningHeaders", tags = { "versioning" }, - value = "", - nickname = "versioningHeaders", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_HEADERS, @@ -53,9 +63,9 @@ default VersioningApiDelegate getDelegate() { headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningHeaders( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningHeaders(versionWithDefaultValue, versionNoDefaultValue, petId); } @@ -72,16 +82,15 @@ default ResponseEntity versioningHeaders( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningMix", tags = { "versioning" }, - value = "", - nickname = "versioningMix", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_MIX, @@ -90,11 +99,11 @@ default ResponseEntity versioningHeaders( params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) default ResponseEntity versioningMix( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, - @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValueHeader", required = true) String versionNoDefaultValueHeader, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, + @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, + @NotNull @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, + @NotNull @Parameter(name = "VersionNoDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValueHeader", required = true) String versionNoDefaultValueHeader, + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningMix(versionWithDefaultValueQuery, versionNoDefaultValueQuery, versionWithDefaultValueHeader, versionNoDefaultValueHeader, petId); } @@ -109,16 +118,15 @@ default ResponseEntity versioningMix( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningQueryParams", tags = { "versioning" }, - value = "", - nickname = "versioningQueryParams", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, @@ -126,9 +134,9 @@ default ResponseEntity versioningMix( params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningQueryParams( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningQueryParams(versionWithDefaultValue, versionNoDefaultValue, petId); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java index 98a2973d5df4..10e13646108b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class VersioningApiController implements VersioningApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..1cb321494e5e --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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("http://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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 4f0ec05cbaf8..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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("http://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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 27c0ef4e9e94..f5a838170f09 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -75,7 +74,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; @@ -104,7 +103,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; @@ -133,7 +132,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; @@ -162,7 +161,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; @@ -191,7 +190,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -220,7 +219,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; @@ -249,7 +248,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -278,7 +277,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -299,7 +298,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; @@ -320,7 +319,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; @@ -341,7 +340,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java index ab1e645bdd49..bc331454a18d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java index c972ed63268b..7a144ebf5184 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d31f39a5bf15..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 329c1e3b1e8b..2845ae04fe0f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -102,7 +101,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; @@ -123,7 +122,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; @@ -144,7 +143,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; @@ -173,7 +172,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; @@ -202,7 +201,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; @@ -223,7 +222,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/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 6539954e3815..1ab94591867d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7b76228526e8..19806eb3beb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES index ade930debbfb..39755ed7c2e0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/java/org/openapitools/api/VersioningApi.java src/main/java/org/openapitools/api/VersioningApiDelegate.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 @@ -66,5 +66,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-spring-pageable-delegatePattern/README.md b/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/README.md +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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-spring-pageable-delegatePattern/pom.xml b/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml index 5b9c5fde9321..4d86f6d1068c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9623b89cec76..9e3a8b563ccd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 AnotherFakeApiDelegate getDelegate() { @@ -35,16 +46,17 @@ default AnotherFakeApiDelegate getDelegate() { * @param body 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, @@ -52,7 +64,7 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java index e27e2fc20ea9..059f1785566c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 09ae50cd9f8a..ffa8a2e29dc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -17,7 +17,18 @@ import org.openapitools.model.OuterComposite; 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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -31,7 +42,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 FakeApiDelegate getDelegate() { @@ -46,22 +57,22 @@ default FakeApiDelegate getDelegate() { * @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 getDelegate().createXmlItem(xmlItem); } @@ -75,23 +86,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterBooleanSerialize(body); } @@ -105,23 +116,23 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param body 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -135,23 +146,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterNumberSerialize(body); } @@ -165,23 +176,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) 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 getDelegate().fakeOuterStringSerialize(body); } @@ -195,22 +206,21 @@ default ResponseEntity fakeOuterStringSerialize( * @param body (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 body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return getDelegate().testBodyWithFileSchema(body); } @@ -224,23 +234,21 @@ default ResponseEntity testBodyWithFileSchema( * @param body (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 body + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -254,16 +262,17 @@ default ResponseEntity testBodyWithQueryParams( * @param body 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 + 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 = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -271,7 +280,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClientModel(body); } @@ -299,39 +308,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") - } + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "http_basic_test") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @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 getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -353,30 +362,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" + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "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 getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -395,26 +404,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 getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -427,22 +436,21 @@ default ResponseEntity testGroupParameters( * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testInlineAdditionalProperties", + summary = "test inline additionalProperties", 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 param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return getDelegate().testInlineAdditionalProperties(param); } @@ -456,23 +464,22 @@ default ResponseEntity testInlineAdditionalProperties( * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testJsonFormData", + summary = "test json serialization of form data", 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 getDelegate().testJsonFormData(param, param2); } @@ -490,25 +497,24 @@ default ResponseEntity testJsonFormData( * @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 = "ioutil", required = true) List ioutil, - @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 = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @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 getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -523,22 +529,19 @@ default ResponseEntity testQueryParameterCollectionFormat( * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFileWithRequiredFile", + summary = "uploads an image (required)", 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, @@ -546,9 +549,9 @@ default ResponseEntity testQueryParameterCollectionFormat( 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 ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java index 726b17779f18..1947c8e3b1a0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiController.java @@ -7,6 +7,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -35,7 +36,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 94d649b96b2c..95ab6c2b1c43 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -20,7 +31,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 FakeClassnameTestApiDelegate getDelegate() { @@ -35,19 +46,20 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body 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, @@ -55,7 +67,7 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 21e28fe8b213..d147735fde1b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index 1dc6bd20193f..54d627166897 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.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.*; @@ -24,7 +35,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 PetApiDelegate getDelegate() { @@ -39,29 +50,25 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation( + @Operation( + operationId = "addPet", + summary = "Add a new pet to the store", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().addPet(body); } @@ -76,29 +83,25 @@ default ResponseEntity addPet( * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", 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 getDelegate().deletePet(petId, apiKey); } @@ -113,32 +116,30 @@ 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, - @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 ) { return getDelegate().findPetsByStatus(status, pageable); } @@ -156,33 +157,32 @@ 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 = "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 = 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) List tags, - @ApiParam(value = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.") @RequestHeader(value = "size", required = false) @Nullable String size, - @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, + @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, + @ParameterObject final Pageable pageable ) { return getDelegate().findPetsByTags(tags, size, pageable); } @@ -198,28 +198,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 ) { return getDelegate().getPetById(petId); } @@ -232,31 +234,28 @@ default ResponseEntity getPetById( * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "listAllPets", + summary = "List all pets", tags = { "pet" }, - value = "List all pets", - nickname = "listAllPets", - notes = "", - 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_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) default ResponseEntity> listAllPets( - @ApiIgnore final Pageable pageable + @ParameterObject final Pageable pageable ) { return getDelegate().listAllPets(pageable); } @@ -272,31 +271,27 @@ default ResponseEntity> listAllPets( * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation( + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return getDelegate().updatePet(body); } @@ -311,30 +306,26 @@ 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", 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 getDelegate().updatePetWithForm(petId, name, status); } @@ -349,22 +340,19 @@ default ResponseEntity updatePetWithForm( * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFile", + summary = "uploads an image", 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, @@ -372,9 +360,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 ) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java index 665635623373..02e80c3d8ded 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,9 @@ 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; @@ -28,7 +29,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java index f5c35b4e1796..0f4f40806bc6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -1,9 +1,9 @@ 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 org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index c374a22d9e81..e7a7686af636 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -21,7 +32,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 StoreApiDelegate getDelegate() { @@ -37,22 +48,22 @@ default StoreApiDelegate getDelegate() { * @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 getDelegate().deleteOrder(orderId); } @@ -65,20 +76,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, @@ -101,25 +112,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 ) { return getDelegate().getOrderById(orderId); } @@ -133,24 +146,25 @@ 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", 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, produces = { "application/xml", "application/json" } ) default 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 ) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java index e9e29a41b4f9..08c70e47712d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 21e1acd37aaf..8a0af0374d36 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -21,7 +32,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 UserApiDelegate getDelegate() { @@ -36,21 +47,21 @@ default UserApiDelegate getDelegate() { * @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" }, - 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 ) default 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 ) { return getDelegate().createUser(body); } @@ -63,21 +74,20 @@ default 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" }, - 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 ) default 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 ) { return getDelegate().createUsersWithArrayInput(body); } @@ -90,21 +100,20 @@ default 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" }, - 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 ) default 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 ) { return getDelegate().createUsersWithListInput(body); } @@ -119,22 +128,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 getDelegate().deleteUser(username); } @@ -149,25 +158,26 @@ 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", 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 ) { return getDelegate().getUserByName(username); } @@ -182,25 +192,26 @@ 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", 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 getDelegate().loginUser(username, password); } @@ -212,15 +223,14 @@ default ResponseEntity loginUser( * * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", 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 @@ -242,23 +252,23 @@ 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 ) 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 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 ) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java index 463838f10ac4..261a67cba26f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java index 8e2143389ad5..645b67cea4a7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; -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.*; @@ -20,7 +31,7 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Validated -@Api(value = "versioning", description = "the versioning API") +@Tag(name = "versioning", description = "the versioning API") public interface VersioningApi { default VersioningApiDelegate getDelegate() { @@ -34,19 +45,18 @@ default VersioningApiDelegate getDelegate() { * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningHeaders", tags = { "versioning" }, - value = "", - nickname = "versioningHeaders", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "VersionWithDefaultValue", value = "", required = true, dataType = "String", paramType = "header"), - @ApiImplicitParam(name = "VersionNoDefaultValue", value = "", required = true, dataType = "String", paramType = "header") + @Parameters({ + @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER), + @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.POST, @@ -55,7 +65,7 @@ default VersioningApiDelegate getDelegate() { headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningHeaders( - @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 ) { return getDelegate().versioningHeaders(petId); } @@ -70,19 +80,18 @@ default ResponseEntity versioningHeaders( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningMix", tags = { "versioning" }, - value = "", - nickname = "versioningMix", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "VersionWithDefaultValueHeader", value = "", required = true, dataType = "String", paramType = "header"), - @ApiImplicitParam(name = "VersionNoDefaultValueHeader", value = "", required = true, dataType = "String", paramType = "header") + @Parameters({ + @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER), + @Parameter(name = "VersionNoDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.POST, @@ -92,9 +101,9 @@ default ResponseEntity versioningHeaders( params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) default ResponseEntity versioningMix( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, + @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningMix(versionWithDefaultValueQuery, versionNoDefaultValueQuery, petId); } @@ -109,16 +118,15 @@ default ResponseEntity versioningMix( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningQueryParams", tags = { "versioning" }, - value = "", - nickname = "versioningQueryParams", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, @@ -126,9 +134,9 @@ default ResponseEntity versioningMix( params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningQueryParams( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningQueryParams(versionWithDefaultValue, versionNoDefaultValue, petId); } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiController.java index 98a2973d5df4..10e13646108b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiController.java @@ -25,7 +25,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class VersioningApiController implements VersioningApi { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..1cb321494e5e --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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("http://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-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 4f0ec05cbaf8..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/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("http://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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 27c0ef4e9e94..f5a838170f09 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -75,7 +74,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; @@ -104,7 +103,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; @@ -133,7 +132,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; @@ -162,7 +161,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; @@ -191,7 +190,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -220,7 +219,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; @@ -249,7 +248,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -278,7 +277,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -299,7 +298,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; @@ -320,7 +319,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; @@ -341,7 +340,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java index ab1e645bdd49..bc331454a18d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java index c972ed63268b..7a144ebf5184 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index 329c1e3b1e8b..2845ae04fe0f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -102,7 +101,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; @@ -123,7 +122,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; @@ -144,7 +143,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; @@ -173,7 +172,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; @@ -202,7 +201,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; @@ -223,7 +222,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/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java index 6539954e3815..1ab94591867d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7b76228526e8..19806eb3beb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES index 166ece42f552..7034b5785ce9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/FILES @@ -12,7 +12,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/VersioningApi.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 @@ -59,5 +59,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-spring-pageable-without-j8/README.md b/samples/server/petstore/springboot-spring-pageable-without-j8/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/README.md +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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-spring-pageable-without-j8/pom.xml b/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml index d678866a095b..a94686b00882 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index edcfe82c908b..11aaf98ccacf 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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 body 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 body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c2db7ca5a815..fe92d94c59ef 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index c2aac684497c..33e568633ae6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -17,7 +17,18 @@ import org.openapitools.model.OuterComposite; 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; @@ -35,7 +46,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() { @@ -50,22 +61,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); @@ -80,23 +91,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) 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); @@ -111,23 +122,23 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param body 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -151,23 +162,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) 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); @@ -182,23 +193,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) 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); @@ -213,22 +224,21 @@ default ResponseEntity fakeOuterStringSerialize( * @param body (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 body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,23 +253,21 @@ default ResponseEntity testBodyWithFileSchema( * @param body (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 body + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -274,16 +282,17 @@ default ResponseEntity testBodyWithQueryParams( * @param body 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 + 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 = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -291,7 +300,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -329,39 +338,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") - } + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "http_basic_test") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @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); @@ -384,30 +393,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" + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "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); @@ -427,26 +436,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); @@ -460,22 +469,21 @@ default ResponseEntity testGroupParameters( * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testInlineAdditionalProperties", + summary = "test inline additionalProperties", 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 param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -490,23 +498,22 @@ default ResponseEntity testInlineAdditionalProperties( * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testJsonFormData", + summary = "test json serialization of form data", 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); @@ -525,25 +532,24 @@ default ResponseEntity testJsonFormData( * @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 = "ioutil", required = true) List ioutil, - @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 = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @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); @@ -559,22 +565,19 @@ default ResponseEntity testQueryParameterCollectionFormat( * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFileWithRequiredFile", + summary = "uploads an image (required)", 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, @@ -582,9 +585,9 @@ default ResponseEntity testQueryParameterCollectionFormat( 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-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed985..0bae72d66b8b 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApiController.java @@ -7,6 +7,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -36,7 +37,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 096ede4fc021..49ccd68da441 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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 body 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 body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 65b695629d43..7b323f19885f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 1d1f1e6003e6..be25dcd616c8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.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.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -28,7 +39,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,25 @@ 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", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,29 +88,25 @@ default ResponseEntity addPet( * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", 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); @@ -119,32 +122,30 @@ 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, - @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 ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -177,33 +178,32 @@ 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 = "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 = 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) List tags, - @ApiParam(value = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.") @RequestHeader(value = "size", required = false) @Nullable String size, - @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, + @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, + @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -234,28 +234,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"))) { @@ -283,31 +285,28 @@ default ResponseEntity getPetById( * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "listAllPets", + summary = "List all pets", tags = { "pet" }, - value = "List all pets", - nickname = "listAllPets", - notes = "", - 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_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) default ResponseEntity> listAllPets( - @ApiIgnore final Pageable pageable + @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -338,31 +337,27 @@ default ResponseEntity> listAllPets( * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation( + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -378,30 +373,26 @@ 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", 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); @@ -417,22 +408,19 @@ default ResponseEntity updatePetWithForm( * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFile", + summary = "uploads an image", 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, @@ -440,9 +428,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-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java index ab60617a7ee1..e8a6155b8443 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,9 @@ 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; @@ -29,7 +30,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index ec4f4a2a6afd..4565d95c246f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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"))) { @@ -154,24 +167,25 @@ 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", 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, produces = { "application/xml", "application/json" } ) default 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 ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java index 1292dc0b721d..903673d56f43 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApiController.java @@ -27,7 +27,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 6cbfa272c0fc..45eed93988be 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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,21 +51,21 @@ default Optional getRequest() { * @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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -68,21 +79,20 @@ default 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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -96,21 +106,20 @@ default 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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,22 +135,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); @@ -157,25 +166,26 @@ 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", 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"))) { @@ -205,25 +215,26 @@ 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", 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); @@ -236,15 +247,14 @@ default ResponseEntity loginUser( * * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", 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 @@ -267,23 +277,23 @@ 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 ) 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 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index 2067b64b6fcb..5875bb3f8f7a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -27,7 +27,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index c0e260919919..32b60180a9f6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; -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 = "versioning", description = "the versioning API") +@Tag(name = "versioning", description = "the versioning API") public interface VersioningApi { default Optional getRequest() { @@ -40,16 +51,15 @@ default Optional getRequest() { * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningHeaders", tags = { "versioning" }, - value = "", - nickname = "versioningHeaders", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_HEADERS, @@ -57,9 +67,9 @@ default Optional getRequest() { headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningHeaders( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @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"))) { @@ -86,16 +96,15 @@ default ResponseEntity versioningHeaders( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningMix", tags = { "versioning" }, - value = "", - nickname = "versioningMix", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_MIX, @@ -104,11 +113,11 @@ default ResponseEntity versioningHeaders( params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) default ResponseEntity versioningMix( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, - @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValueHeader", required = true) String versionNoDefaultValueHeader, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, + @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, + @NotNull @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, + @NotNull @Parameter(name = "VersionNoDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValueHeader", required = true) String versionNoDefaultValueHeader, + @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"))) { @@ -133,16 +142,15 @@ default ResponseEntity versioningMix( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningQueryParams", tags = { "versioning" }, - value = "", - nickname = "versioningQueryParams", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, @@ -150,9 +158,9 @@ default ResponseEntity versioningMix( params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningQueryParams( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @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"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java index 08ad65ce4902..5a4ce2d886aa 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class VersioningApiController implements VersioningApi { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..1cb321494e5e --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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("http://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-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 4f0ec05cbaf8..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/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("http://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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 27c0ef4e9e94..f5a838170f09 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -75,7 +74,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; @@ -104,7 +103,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; @@ -133,7 +132,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; @@ -162,7 +161,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; @@ -191,7 +190,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -220,7 +219,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; @@ -249,7 +248,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -278,7 +277,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -299,7 +298,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; @@ -320,7 +319,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; @@ -341,7 +340,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java index ab1e645bdd49..bc331454a18d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -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-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java index c972ed63268b..7a144ebf5184 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d31f39a5bf15..000000000000 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 329c1e3b1e8b..2845ae04fe0f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -102,7 +101,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; @@ -123,7 +122,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; @@ -144,7 +143,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; @@ -173,7 +172,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; @@ -202,7 +201,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; @@ -223,7 +222,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/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java index 6539954e3815..1ab94591867d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7b76228526e8..19806eb3beb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES index 166ece42f552..7034b5785ce9 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/FILES @@ -12,7 +12,7 @@ src/main/java/org/openapitools/api/UserApi.java src/main/java/org/openapitools/api/VersioningApi.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 @@ -59,5 +59,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-spring-pageable/README.md b/samples/server/petstore/springboot-spring-pageable/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-spring-pageable/README.md +++ b/samples/server/petstore/springboot-spring-pageable/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-spring-pageable/pom.xml b/samples/server/petstore/springboot-spring-pageable/pom.xml index 83bec474076f..8afd0658c380 100644 --- a/samples/server/petstore/springboot-spring-pageable/pom.xml +++ b/samples/server/petstore/springboot-spring-pageable/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-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index edcfe82c908b..11aaf98ccacf 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/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 body 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 body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c2db7ca5a815..fe92d94c59ef 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class AnotherFakeApiController implements AnotherFakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index c2aac684497c..33e568633ae6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -17,7 +17,18 @@ import org.openapitools.model.OuterComposite; 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; @@ -35,7 +46,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() { @@ -50,22 +61,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); @@ -80,23 +91,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) 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); @@ -111,23 +122,23 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param body 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body + @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -151,23 +162,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output number", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) 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); @@ -182,23 +193,23 @@ 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 + responses = { + @ApiResponse(responseCode = "200", description = "Output string", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) 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); @@ -213,22 +224,21 @@ default ResponseEntity fakeOuterStringSerialize( * @param body (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 body + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,23 +253,21 @@ default ResponseEntity testBodyWithFileSchema( * @param body (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 body + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -274,16 +282,17 @@ default ResponseEntity testBodyWithQueryParams( * @param body 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 + 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 = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -291,7 +300,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -329,39 +338,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") - } + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + }, + security = { + @SecurityRequirement(name = "http_basic_test") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) @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); @@ -384,30 +393,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" + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request"), + @ApiResponse(responseCode = "404", description = "Not found") + } ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "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); @@ -427,26 +436,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); @@ -460,22 +469,21 @@ default ResponseEntity testGroupParameters( * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testInlineAdditionalProperties", + summary = "test inline additionalProperties", 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 param + @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -490,23 +498,22 @@ default ResponseEntity testInlineAdditionalProperties( * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testJsonFormData", + summary = "test json serialization of form data", 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); @@ -525,25 +532,24 @@ default ResponseEntity testJsonFormData( * @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 = "ioutil", required = true) List ioutil, - @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 = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @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); @@ -559,22 +565,19 @@ default ResponseEntity testQueryParameterCollectionFormat( * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFileWithRequiredFile", + summary = "uploads an image (required)", 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, @@ -582,9 +585,9 @@ default ResponseEntity testQueryParameterCollectionFormat( 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-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java index 5ae5d5fed985..0bae72d66b8b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApiController.java @@ -7,6 +7,7 @@ import java.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; +import org.springframework.lang.Nullable; import java.time.OffsetDateTime; import org.openapitools.model.OuterComposite; import org.openapitools.model.User; @@ -36,7 +37,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 096ede4fc021..49ccd68da441 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/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 body 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 body + @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 65b695629d43..7b323f19885f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class FakeClassnameTestApiController implements FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 1d1f1e6003e6..be25dcd616c8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.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.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -28,7 +39,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,25 @@ 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", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,29 +88,25 @@ default ResponseEntity addPet( * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "deletePet", + summary = "Deletes a pet", 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); @@ -119,32 +122,30 @@ 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, - @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 ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -177,33 +178,32 @@ 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 = "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 = 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) List tags, - @ApiParam(value = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.") @RequestHeader(value = "size", required = false) @Nullable String size, - @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, + @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, + @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -234,28 +234,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"))) { @@ -283,31 +285,28 @@ default ResponseEntity getPetById( * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation( + @Operation( + operationId = "listAllPets", + summary = "List all pets", tags = { "pet" }, - value = "List all pets", - nickname = "listAllPets", - notes = "", - 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_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) default ResponseEntity> listAllPets( - @ApiIgnore final Pageable pageable + @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -338,31 +337,27 @@ default ResponseEntity> listAllPets( * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation( + @Operation( + operationId = "updatePet", + summary = "Update an existing pet", 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 body + @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -378,30 +373,26 @@ 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", 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); @@ -417,22 +408,19 @@ default ResponseEntity updatePetWithForm( * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "uploadFile", + summary = "uploads an image", 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, @@ -440,9 +428,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-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java index ab60617a7ee1..e8a6155b8443 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApiController.java @@ -1,8 +1,9 @@ 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; @@ -29,7 +30,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class PetApiController implements PetApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index ec4f4a2a6afd..4565d95c246f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/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"))) { @@ -154,24 +167,25 @@ 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", 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, produces = { "application/xml", "application/json" } ) default 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 ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java index 1292dc0b721d..903673d56f43 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApiController.java @@ -27,7 +27,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 6cbfa272c0fc..45eed93988be 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/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,21 +51,21 @@ default Optional getRequest() { * @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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -68,21 +79,20 @@ default 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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -96,21 +106,20 @@ default 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" }, - 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 ) default 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,22 +135,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); @@ -157,25 +166,26 @@ 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", 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"))) { @@ -205,25 +215,26 @@ 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", 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); @@ -236,15 +247,14 @@ default ResponseEntity loginUser( * * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "logoutUser", + summary = "Logs out current logged in user session", 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 @@ -267,23 +277,23 @@ 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 ) 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 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 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java index 2067b64b6fcb..5875bb3f8f7a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApiController.java @@ -27,7 +27,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class UserApiController implements UserApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java index e50a9faeb09f..adfe9a84555b 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ModelApiResponse; -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 = "versioning", description = "the versioning API") +@Tag(name = "versioning", description = "the versioning API") public interface VersioningApi { default Optional getRequest() { @@ -38,19 +49,18 @@ default Optional getRequest() { * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningHeaders", tags = { "versioning" }, - value = "", - nickname = "versioningHeaders", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "VersionWithDefaultValue", value = "", required = true, dataType = "String", paramType = "header"), - @ApiImplicitParam(name = "VersionNoDefaultValue", value = "", required = true, dataType = "String", paramType = "header") + @Parameters({ + @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER), + @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.POST, @@ -59,7 +69,7 @@ default Optional getRequest() { headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningHeaders( - @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"))) { @@ -84,19 +94,18 @@ default ResponseEntity versioningHeaders( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningMix", tags = { "versioning" }, - value = "", - nickname = "versioningMix", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @ApiImplicitParams({ - @ApiImplicitParam(name = "VersionWithDefaultValueHeader", value = "", required = true, dataType = "String", paramType = "header"), - @ApiImplicitParam(name = "VersionNoDefaultValueHeader", value = "", required = true, dataType = "String", paramType = "header") + @Parameters({ + @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER), + @Parameter(name = "VersionNoDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) }) @RequestMapping( method = RequestMethod.POST, @@ -106,9 +115,9 @@ default ResponseEntity versioningHeaders( params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) default ResponseEntity versioningMix( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, + @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, + @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"))) { @@ -133,16 +142,15 @@ default ResponseEntity versioningMix( * @param petId ID of pet to update (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "versioningQueryParams", tags = { "versioning" }, - value = "", - nickname = "versioningQueryParams", - notes = "", - response = ModelApiResponse.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = ModelApiResponse.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @RequestMapping( method = RequestMethod.POST, value = VersioningApi.PATH_VERSIONING_QUERY_PARAMS, @@ -150,9 +158,9 @@ default ResponseEntity versioningMix( params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) default ResponseEntity versioningQueryParams( - @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId + @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, + @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, + @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"))) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApiController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApiController.java index 08ad65ce4902..5a4ce2d886aa 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApiController.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApiController.java @@ -26,7 +26,7 @@ import java.util.Optional; import javax.annotation.Generated; -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") @Controller @RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") public class VersioningApiController implements VersioningApi { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-spring-pageable/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-spring-pageable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..1cb321494e5e --- /dev/null +++ b/samples/server/petstore/springboot-spring-pageable/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("http://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-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 4f0ec05cbaf8..000000000000 --- a/samples/server/petstore/springboot-spring-pageable/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("http://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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index e9dd14f56239..df23b2e0518f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index 3615592aa420..6455b1d28477 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 4002fe1cafc8..cf9ce0f5e925 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 27c0ef4e9e94..f5a838170f09 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -75,7 +74,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; @@ -104,7 +103,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; @@ -133,7 +132,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; @@ -162,7 +161,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; @@ -191,7 +190,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -220,7 +219,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; @@ -249,7 +248,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -278,7 +277,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -299,7 +298,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; @@ -320,7 +319,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; @@ -341,7 +340,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index a1585b57526f..3bdc569be02e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index bf22d701b5e4..0848aa710a2e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index a9ad3cde1aaf..129dd92b5337 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,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-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 1311e77bd226..143e46a8644e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,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-spring-pageable/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java index ab1e645bdd49..bc331454a18d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -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-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 895f299988a1..eeae40cafa74 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index e7ce23c89bbe..1b5d034f4ac8 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -48,7 +47,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-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 513e4803a07e..5951b8f4f981 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java index 9d852cbdd084..afedf33fe0ba 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,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; @@ -66,7 +65,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; @@ -87,7 +86,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; @@ -108,7 +107,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; @@ -129,7 +128,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; @@ -150,7 +149,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-spring-pageable/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java index c972ed63268b..7a144ebf5184 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java index 90617a6ae32c..ecdf126c9eda 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -48,7 +47,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; @@ -69,7 +68,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-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java index fd544e5df23b..3b17108cd459 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java index 7aeec07e4f3a..7f3a323e6af1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,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-spring-pageable/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java index 0c58588e64ab..36c65b313657 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,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-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index 51bc8303094b..1c6836270e59 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -112,7 +111,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; @@ -141,7 +140,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-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java index 212f34aff977..3d3b901e796d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,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; @@ -223,7 +222,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; @@ -244,7 +243,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; @@ -265,7 +264,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; @@ -286,7 +285,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-spring-pageable/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java index 78c59285275a..3c808c2564fd 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,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-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 5b4e1753fdbe..b1da5f0f051d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -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.*; @@ -42,7 +41,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; @@ -71,7 +70,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-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index 967fec0da07b..bce3371774c1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,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; @@ -110,7 +109,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; @@ -131,7 +130,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; @@ -154,7 +153,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; @@ -177,7 +176,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; @@ -200,7 +199,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; @@ -221,7 +220,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; @@ -242,7 +241,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; @@ -263,7 +262,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; @@ -284,7 +283,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; @@ -305,7 +304,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; @@ -326,7 +325,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; @@ -347,7 +346,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; @@ -368,7 +367,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-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index e63ae315a3e1..9e99407cc172 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,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; @@ -60,7 +59,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-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index 942e32302829..0df5143e02ae 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 3bd85bd2cb19..a2b9f47bf9ca 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(@Nullable UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(@Nullable OffsetDate * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java index a72cfadef665..c750a0d6534e 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200Response 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-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java index 9c6b66e2f48d..f4bc1158e557 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -41,7 +40,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; @@ -62,7 +61,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; @@ -83,7 +82,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/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java index 80fdc758baa0..60a860c7e5a6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(@Nullable String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123list() { return _123list; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java index dca7af0ce9a4..e1062706a03f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java index f44b3c0451c9..1ac9b0316cfb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(@Nullable Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123number() { return _123number; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java index 09215d0986d9..24f388d18059 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java index e91482f5fd5d..a8a085046bed 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -86,7 +85,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; @@ -107,7 +106,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; @@ -128,7 +127,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; @@ -149,7 +148,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; @@ -170,7 +169,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; @@ -191,7 +190,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/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java index 6c2522771275..f33e0a655695 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 329c1e3b1e8b..2845ae04fe0f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -102,7 +101,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; @@ -123,7 +122,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; @@ -144,7 +143,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; @@ -173,7 +172,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; @@ -202,7 +201,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; @@ -223,7 +222,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/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java index fe30f5929587..8ca5a82f9c01 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst 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; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java index 6539954e3815..1ab94591867d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java index b5386348fb16..ece3f449fa18 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -37,7 +36,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; @@ -58,7 +57,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/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7b76228526e8..19806eb3beb9 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 24392490e464..c1d22cceb21c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java index fe12d1abb8c3..1e26e2d0fc35 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-spring-pageable/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.*; @@ -49,7 +48,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; @@ -70,7 +69,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; @@ -91,7 +90,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; @@ -112,7 +111,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; @@ -133,7 +132,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; @@ -154,7 +153,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; @@ -175,7 +174,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; @@ -196,7 +195,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-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index aa2acf368944..bb65cd50c02f 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 95a549621f7f..0f85b5e51c33 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.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-useoptional/README.md b/samples/server/petstore/springboot-useoptional/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-useoptional/README.md +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index ceca9cc0d470..c43b804ca9e6 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index ed272236ed9b..109727169a95 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 18f5d6d2277b..70f3c949d928 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/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) Optional body + @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Optional 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) Optional outerComposite + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Optional 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) Optional body + @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Optional 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) Optional body + @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Optional 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") @Valid @RequestParam(value = "integer", required = false) Optional integer, - @ApiParam(value = "None") @Valid @RequestParam(value = "int32", required = false) Optional int32, - @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Optional int64, - @ApiParam(value = "None") @Valid @RequestParam(value = "float", required = false) Optional _float, - @ApiParam(value = "None") @Valid @RequestParam(value = "string", required = false) Optional 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) Optional date, - @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Optional dateTime, - @ApiParam(value = "None") @Valid @RequestParam(value = "password", required = false) Optional password, - @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) Optional 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") @Valid @RequestParam(value = "integer", required = false) Optional integer, + @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Optional int32, + @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Optional int64, + @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Optional _float, + @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) Optional 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) Optional date, + @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Optional dateTime, + @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) Optional password, + @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) Optional 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) Optional> enumHeaderStringArray, - @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) Optional> enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) Optional 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) Optional> enumHeaderStringArray, + @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional 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) Optional> 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") Optional enumQueryString, + @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, + @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) Optional> enumFormStringArray, + @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) Optional 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) Optional stringGroup, - @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Optional 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) Optional stringGroup, + @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, + @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Optional 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) Optional 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) Optional additionalMetadata ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 878513a1a30c..38082e99ec88 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 4c9fb36d5c3a..befb691a9e58 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/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) Optional 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) Optional 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) Optional name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) Optional 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) Optional name, + @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) Optional 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) Optional 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) Optional 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-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 317a6c2dd8ed..26bb56b39575 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 19182a0968d7..8e54ff471a7e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/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-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index 33f57e08d3f6..000000000000 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java +++ /dev/null @@ -1,73 +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 java.util.Optional; -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) - .genericModelSubstitutes(Optional.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-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 69c5f9fd575b..c698836cbeb9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.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.*; @@ -39,7 +38,7 @@ public AdditionalPropertiesAnyType name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index bff8651495c8..e96e31937019 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public AdditionalPropertiesArray name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index bac8947c0db3..97f61c74f0c1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.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.*; @@ -39,7 +38,7 @@ public AdditionalPropertiesBoolean name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index a57529f15fc0..b058b88da42b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/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.Arrays; import java.util.HashMap; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -78,7 +77,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; @@ -107,7 +106,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; @@ -136,7 +135,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; @@ -165,7 +164,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; @@ -194,7 +193,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -223,7 +222,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; @@ -252,7 +251,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -281,7 +280,7 @@ public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -302,7 +301,7 @@ public AdditionalPropertiesClass anytype1(Object anytype1) { * @return anytype1 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_1") public Optional getAnytype1() { return anytype1; @@ -323,7 +322,7 @@ public AdditionalPropertiesClass anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -343,7 +342,7 @@ public AdditionalPropertiesClass anytype3(Object anytype3) { * @return anytype3 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_3") public Optional getAnytype3() { return anytype3; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java index 4c24477af6ba..125d3ea9db58 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.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.*; @@ -39,7 +38,7 @@ public AdditionalPropertiesInteger name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java index 06debd16f824..947aaa40bac7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public AdditionalPropertiesNumber name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java index 0f864e63e522..bba41e3499df 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public AdditionalPropertiesObject name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java index 85c9c807a00e..8862a7ec9c48 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.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.*; @@ -39,7 +38,7 @@ public AdditionalPropertiesString name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java index f5e99f0069e5..2cd2524acbca 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.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.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.*; @@ -62,7 +61,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; @@ -83,7 +82,7 @@ public Animal color(String color) { * @return color */ - @ApiModelProperty(value = "") + @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("color") public Optional getColor() { return color; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index d7709f15bb22..24237ffb3548 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -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.*; @@ -48,7 +47,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-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 89c4dba8e12c..9368c4e02246 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -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.*; @@ -48,7 +47,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-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 88965c7bc665..1751c58b5abf 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -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.*; @@ -54,7 +53,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; @@ -83,7 +82,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; @@ -112,7 +111,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-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java index 0933c0187c1d..23e6571d4eb1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java @@ -8,14 +8,13 @@ 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 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.*; @@ -91,7 +90,7 @@ public BigCat kind(KindEnum kind) { * @return kind */ - @ApiModelProperty(value = "") + @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("kind") public Optional getKind() { return kind; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java index 5fad4a24fb66..92a71adab21c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.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.*; @@ -45,7 +44,7 @@ public Capitalization smallCamel(String smallCamel) { * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") public Optional getSmallCamel() { return smallCamel; @@ -66,7 +65,7 @@ public Capitalization capitalCamel(String capitalCamel) { * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") public Optional getCapitalCamel() { return capitalCamel; @@ -87,7 +86,7 @@ public Capitalization smallSnake(String smallSnake) { * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("small_Snake") public Optional getSmallSnake() { return smallSnake; @@ -108,7 +107,7 @@ public Capitalization capitalSnake(String capitalSnake) { * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("Capital_Snake") public Optional getCapitalSnake() { return capitalSnake; @@ -129,7 +128,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SCA_ETH_Flow_Points") public Optional getScAETHFlowPoints() { return scAETHFlowPoints; @@ -150,7 +149,7 @@ public Capitalization ATT_NAME(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 Optional getATTNAME() { return ATT_NAME; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java index 74366371a08d..2358a6e8f0d2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java @@ -7,14 +7,13 @@ 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 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.*; @@ -59,7 +58,7 @@ public Cat declawed(Boolean declawed) { * @return declawed */ - @ApiModelProperty(value = "") + @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("declawed") public Optional getDeclawed() { return declawed; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java index c1a096acfa5c..7d1873047f51 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/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.*; @@ -48,7 +47,7 @@ public Category id(Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public Optional getId() { return id; @@ -69,7 +68,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-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java index 4f19baef6352..382f88ed8bbd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullable; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -43,7 +42,7 @@ public ChildWithNullable otherProperty(String otherProperty) { * @return otherProperty */ - @ApiModelProperty(value = "") + @Schema(name = "otherProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("otherProperty") public Optional getOtherProperty() { return otherProperty; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java index 3954b445ebee..f955b43ca765 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.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 @@ * 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 { @@ -36,7 +35,7 @@ public ClassModel propertyClass(String propertyClass) { * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("_class") public Optional getPropertyClass() { return propertyClass; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java index c399568a0754..a5cc3b4b2998 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.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.*; @@ -35,7 +34,7 @@ public Client client(String client) { * @return client */ - @ApiModelProperty(value = "") + @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("client") public Optional getClient() { return client; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java index 35de82f2f3ff..7d54db9e29ea 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -70,7 +69,7 @@ public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -98,7 +97,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 JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -127,7 +126,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; @@ -156,7 +155,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 JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java index 35d406e8d0b2..6bd7951d8e4b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java @@ -7,14 +7,13 @@ 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 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.*; @@ -51,7 +50,7 @@ public Dog breed(String breed) { * @return breed */ - @ApiModelProperty(value = "") + @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("breed") public Optional getBreed() { return breed; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index 8419f1de5aaf..73d63b6a2755 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -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.*; @@ -112,7 +111,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("just_symbol") public Optional getJustSymbol() { return justSymbol; @@ -141,7 +140,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-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java index 76f6e179950e..0b29b49d0c16 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java @@ -7,6 +7,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-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java index abaedc83dc8f..2b45a9a15c3c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java @@ -6,14 +6,13 @@ 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 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.*; @@ -202,7 +201,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * @return enumString */ - @ApiModelProperty(value = "") + @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_string") public Optional getEnumString() { return enumString; @@ -223,7 +222,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; @@ -244,7 +243,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_integer") public Optional getEnumInteger() { return enumInteger; @@ -265,7 +264,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("enum_number") public Optional getEnumNumber() { return enumNumber; @@ -286,7 +285,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * @return outerEnum */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") public Optional getOuterEnum() { return outerEnum; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java index 68c2fd76dbf5..1604f9a68223 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.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 @@ * 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 { @@ -36,7 +35,7 @@ public File sourceURI(String sourceURI) { * @return sourceURI */ - @ApiModelProperty(value = "Test capitalization") + @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("sourceURI") public Optional getSourceURI() { return sourceURI; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index a6c07fe1ca79..a998f0fcce05 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -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.*; @@ -42,7 +41,7 @@ public FileSchemaTestClass file(File file) { * @return file */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") public Optional getFile() { return file; @@ -71,7 +70,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-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index 0c9d9fc50798..a693ea6a2ea3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public FormatTest integer(Integer integer) { * @return integer */ - @ApiModelProperty(value = "") + @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer") public Optional<@Min(value = 10) @Max(value = 100) Integer> getInteger() { return integer; @@ -110,7 +109,7 @@ public FormatTest int32(Integer int32) { * @return int32 */ - @ApiModelProperty(value = "") + @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int32") public Optional<@Min(value = 20) @Max(value = 200) Integer> getInt32() { return int32; @@ -131,7 +130,7 @@ public FormatTest int64(Long int64) { * @return int64 */ - @ApiModelProperty(value = "") + @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") public Optional getInt64() { return int64; @@ -154,7 +153,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; @@ -177,7 +176,7 @@ public FormatTest _float(Float _float) { * @return _float */ - @ApiModelProperty(value = "") + @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("float") public Optional<@DecimalMin(value = "54.3") @DecimalMax(value = "987.6") Float> getFloat() { return _float; @@ -200,7 +199,7 @@ public FormatTest _double(Double _double) { * @return _double */ - @ApiModelProperty(value = "") + @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("double") public Optional<@DecimalMin(value = "67.8") @DecimalMax(value = "123.4") Double> getDouble() { return _double; @@ -221,7 +220,7 @@ public FormatTest string(String string) { * @return string */ - @ApiModelProperty(value = "") + @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") public Optional<@Pattern(regexp = "/[a-z]/i") String> getString() { return string; @@ -242,7 +241,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; @@ -263,7 +262,7 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { * @return binary */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("binary") public Optional getBinary() { return binary; @@ -284,7 +283,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; @@ -305,7 +304,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public Optional getDateTime() { return dateTime; @@ -326,7 +325,7 @@ public FormatTest uuid(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 Optional getUuid() { return uuid; @@ -347,7 +346,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; @@ -368,7 +367,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * @return bigDecimal */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("BigDecimal") public Optional getBigDecimal() { return bigDecimal; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index 7ddd21b6232a..5aeff76da327 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.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.*; @@ -39,7 +38,7 @@ public HasOnlyReadOnly bar(String bar) { * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") public Optional getBar() { return bar; @@ -60,7 +59,7 @@ public HasOnlyReadOnly foo(String foo) { * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("foo") public Optional getFoo() { return foo; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index 8a5e09eedb5d..9ccfc3b976eb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.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.HashMap; import java.util.Map; 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.*; @@ -91,7 +90,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; @@ -120,7 +119,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; @@ -149,7 +148,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; @@ -178,7 +177,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 getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 368684ed1399..068a7e3bc69a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -47,7 +46,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public Optional getUuid() { return uuid; @@ -68,7 +67,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public Optional getDateTime() { return dateTime; @@ -97,7 +96,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java index 9e383c288421..bb070d76e5b1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200Response { @@ -40,7 +39,7 @@ public Model200Response name(Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; @@ -61,7 +60,7 @@ public Model200Response propertyClass(String propertyClass) { * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("class") public Optional getPropertyClass() { return propertyClass; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java index 9452aa539856..d2aa1a9c7723 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/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.*; @@ -41,7 +40,7 @@ public ModelApiResponse code(Integer code) { * @return code */ - @ApiModelProperty(value = "") + @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") public Optional getCode() { return code; @@ -62,7 +61,7 @@ public ModelApiResponse type(String type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public Optional getType() { return type; @@ -83,7 +82,7 @@ public ModelApiResponse message(String message) { * @return message */ - @ApiModelProperty(value = "") + @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("message") public Optional getMessage() { return message; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index d61b764d4be1..000000000000 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@ApiModel(description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @ApiModelProperty(value = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java index 2e04bb644304..fec565b5351e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.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.*; @@ -37,7 +36,7 @@ public ModelList _123list(String _123list) { * @return _123list */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public Optional get123list() { return _123list; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java index 2ec928492287..6c90f3d6bdc1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ModelReturn { @@ -38,7 +37,7 @@ public ModelReturn _return(Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public Optional getReturn() { return _return; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java index 787d65c6a9d6..f1836e4a9b73 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Name { @@ -53,7 +52,7 @@ public Name name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -74,7 +73,7 @@ public Name snakeCase(Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public Optional getSnakeCase() { return snakeCase; @@ -95,7 +94,7 @@ public Name property(String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public Optional getProperty() { return property; @@ -116,7 +115,7 @@ public Name _123number(Integer _123number) { * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public Optional get123number() { return _123number; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java index eb057fb3c7b0..c2e23ca8c595 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.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.Arrays; import java.util.HashMap; import java.util.Map; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public NullableMapProperty putLanguageValuesItem(String key, String languageValu * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java index a7b5a622860a..ed312ae8b91f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java @@ -4,14 +4,13 @@ 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 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.*; @@ -36,7 +35,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public Optional getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java index 7e1a00394ef0..584b52885d85 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/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.*; @@ -86,7 +85,7 @@ public Order id(Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public Optional getId() { return id; @@ -107,7 +106,7 @@ public Order petId(Long petId) { * @return petId */ - @ApiModelProperty(value = "") + @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") public Optional getPetId() { return petId; @@ -128,7 +127,7 @@ public Order quantity(Integer quantity) { * @return quantity */ - @ApiModelProperty(value = "") + @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") public Optional getQuantity() { return quantity; @@ -149,7 +148,7 @@ public Order shipDate(OffsetDateTime shipDate) { * @return shipDate */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("shipDate") public Optional getShipDate() { return shipDate; @@ -170,7 +169,7 @@ public Order status(StatusEnum status) { * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("status") public Optional getStatus() { return status; @@ -191,7 +190,7 @@ public Order complete(Boolean complete) { * @return complete */ - @ApiModelProperty(value = "") + @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("complete") public Optional getComplete() { return complete; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java index 19ce8e9a9b72..19b1047b0e4d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java @@ -4,14 +4,13 @@ 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 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.*; @@ -40,7 +39,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public Optional getMyNumber() { return myNumber; @@ -61,7 +60,7 @@ public OuterComposite myString(String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public Optional getMyString() { return myString; @@ -82,7 +81,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public Optional getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java index 3c500c3712c7..34c02595cee7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java @@ -7,6 +7,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-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java index abcbaddba880..d2bcd0175f45 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java @@ -8,8 +8,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -18,6 +16,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 ParentWithNullable type(TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public Optional getType() { return type; @@ -107,7 +106,7 @@ public ParentWithNullable nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 8b9c6efb8833..7b722fc3baf9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -6,8 +6,6 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,7 @@ public Pet id(Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public Optional getId() { return id; @@ -127,7 +126,7 @@ public Pet category(Category category) { * @return category */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") public Optional getCategory() { return category; @@ -148,7 +147,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; @@ -177,7 +176,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -207,7 +206,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; @@ -229,7 +228,7 @@ public Pet status(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 Optional getStatus() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 2347eff45e7a..a5102a8304aa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.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.*; @@ -37,7 +36,7 @@ public ReadOnlyFirst bar(String bar) { * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") public Optional getBar() { return bar; @@ -58,7 +57,7 @@ public ReadOnlyFirst baz(String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public Optional getBaz() { return baz; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java index b83b884483d6..da8b0eb3f947 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.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.*; @@ -41,7 +40,7 @@ public ResponseObjectWithDifferentFieldNames normalPropertyName(String normalPro * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public Optional getNormalPropertyName() { return normalPropertyName; @@ -62,7 +61,7 @@ public ResponseObjectWithDifferentFieldNames UPPER_CASE_PROPERTY_SNAKE(String UP * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public Optional getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -83,7 +82,7 @@ public ResponseObjectWithDifferentFieldNames lowerCasePropertyDashes(String lowe * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public Optional getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -104,7 +103,7 @@ public ResponseObjectWithDifferentFieldNames propertyNameWithSpaces(String prope * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public Optional getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index e1fafe867266..caf96c7ca700 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.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.*; @@ -37,7 +36,7 @@ public class SpecialModelName { * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public Optional get$SpecialPropertyName() { return $specialPropertyName; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java index 28625fd8c0ca..7469c99fa27b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/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.*; @@ -37,7 +36,7 @@ public Tag id(Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public Optional getId() { return id; @@ -58,7 +57,7 @@ public Tag name(String name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public Optional getName() { return name; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index 1b98e49622bc..90d526e8992b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.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; @@ -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.*; @@ -63,7 +62,7 @@ public TypeHolderDefault stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -84,7 +83,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -105,7 +104,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -126,7 +125,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -155,7 +154,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index e9bf2dfb584c..30b90a133b73 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.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; @@ -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.*; @@ -66,7 +65,7 @@ public TypeHolderExample stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -87,7 +86,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -108,7 +107,7 @@ public TypeHolderExample floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -129,7 +128,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -150,7 +149,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -179,7 +178,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java index d67d45f7565a..db89ed6bfe6f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot-useoptional/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.*; @@ -49,7 +48,7 @@ public User id(Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public Optional getId() { return id; @@ -70,7 +69,7 @@ public User username(String username) { * @return username */ - @ApiModelProperty(value = "") + @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") public Optional getUsername() { return username; @@ -91,7 +90,7 @@ public User firstName(String firstName) { * @return firstName */ - @ApiModelProperty(value = "") + @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") public Optional getFirstName() { return firstName; @@ -112,7 +111,7 @@ public User lastName(String lastName) { * @return lastName */ - @ApiModelProperty(value = "") + @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") public Optional getLastName() { return lastName; @@ -133,7 +132,7 @@ public User email(String email) { * @return email */ - @ApiModelProperty(value = "") + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") public Optional getEmail() { return email; @@ -154,7 +153,7 @@ public User password(String password) { * @return password */ - @ApiModelProperty(value = "") + @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") public Optional getPassword() { return password; @@ -175,7 +174,7 @@ public User phone(String phone) { * @return phone */ - @ApiModelProperty(value = "") + @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") public Optional getPhone() { return phone; @@ -196,7 +195,7 @@ public User userStatus(Integer userStatus) { * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("userStatus") public Optional getUserStatus() { return userStatus; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 9b880e5187b6..583505c1ebf8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.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; @@ -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.*; @@ -104,7 +103,7 @@ public XmlItem attributeString(String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public Optional getAttributeString() { return attributeString; @@ -125,7 +124,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public Optional getAttributeNumber() { return attributeNumber; @@ -146,7 +145,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public Optional getAttributeInteger() { return attributeInteger; @@ -167,7 +166,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public Optional getAttributeBoolean() { return attributeBoolean; @@ -196,7 +195,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -217,7 +216,7 @@ public XmlItem nameString(String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public Optional getNameString() { return nameString; @@ -238,7 +237,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public Optional getNameNumber() { return nameNumber; @@ -259,7 +258,7 @@ public XmlItem nameInteger(Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public Optional getNameInteger() { return nameInteger; @@ -280,7 +279,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public Optional getNameBoolean() { return nameBoolean; @@ -309,7 +308,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -338,7 +337,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -359,7 +358,7 @@ public XmlItem prefixString(String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public Optional getPrefixString() { return prefixString; @@ -380,7 +379,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public Optional getPrefixNumber() { return prefixNumber; @@ -401,7 +400,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public Optional getPrefixInteger() { return prefixInteger; @@ -422,7 +421,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public Optional getPrefixBoolean() { return prefixBoolean; @@ -451,7 +450,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -480,7 +479,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -501,7 +500,7 @@ public XmlItem namespaceString(String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public Optional getNamespaceString() { return namespaceString; @@ -522,7 +521,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public Optional getNamespaceNumber() { return namespaceNumber; @@ -543,7 +542,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public Optional getNamespaceInteger() { return namespaceInteger; @@ -564,7 +563,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public Optional getNamespaceBoolean() { return namespaceBoolean; @@ -593,7 +592,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -643,7 +642,7 @@ public XmlItem prefixNsString(String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public Optional getPrefixNsString() { return prefixNsString; @@ -664,7 +663,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public Optional getPrefixNsNumber() { return prefixNsNumber; @@ -685,7 +684,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public Optional getPrefixNsInteger() { return prefixNsInteger; @@ -706,7 +705,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public Optional getPrefixNsBoolean() { return prefixNsBoolean; @@ -735,7 +734,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -764,7 +763,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray; diff --git a/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES index 9f716ae63a6a..26fecc9640b4 100644 --- a/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES @@ -12,7 +12,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/AdditionalPropertiesClassDto.java src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java src/main/java/org/openapitools/model/AnimalDto.java @@ -65,5 +65,4 @@ src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesReque src/main/java/org/openapitools/model/UserDto.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-x-implements-skip/README.md b/samples/server/petstore/springboot-x-implements-skip/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot-x-implements-skip/README.md +++ b/samples/server/petstore/springboot-x-implements-skip/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-x-implements-skip/pom.xml b/samples/server/petstore/springboot-x-implements-skip/pom.xml index a1b3fc8f0e40..84658573bdf6 100644 --- a/samples/server/petstore/springboot-x-implements-skip/pom.xml +++ b/samples/server/petstore/springboot-x-implements-skip/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-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java index 4de5bcc13cbb..ecf76de4cfcc 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ClientDto; -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 clientDto 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 = ClientDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.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) @NotNull @Valid @RequestBody ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java index f3d5c45ff155..cbd00e6568af 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java @@ -23,7 +23,18 @@ import org.openapitools.model.PetDto; import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequestDto; import org.openapitools.model.UserDto; -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; @@ -41,7 +52,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() { @@ -55,16 +66,16 @@ default Optional getRequest() { * * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "fakeBigDecimalMap", + description = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", tags = { "fake" }, - value = "", - nickname = "fakeBigDecimalMap", - notes = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", - response = FakeBigDecimalMap200ResponseDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = FakeBigDecimalMap200ResponseDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = FakeBigDecimalMap200ResponseDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.GET, value = FakeApi.PATH_FAKE_BIG_DECIMAL_MAP, @@ -93,16 +104,16 @@ default ResponseEntity fakeBigDecimalMap( * * @return The instance started successfully (status code 200) */ - @ApiOperation( + @Operation( + operationId = "fakeHealthGet", + summary = "Health check endpoint", tags = { "fake" }, - value = "Health check endpoint", - nickname = "fakeHealthGet", - notes = "", - response = HealthCheckResultDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResultDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "The instance started successfully", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = HealthCheckResultDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.GET, value = FakeApi.PATH_FAKE_HEALTH_GET, @@ -134,27 +145,26 @@ default ResponseEntity fakeHealthGet( * @param header1 header parameter (optional) * @return The instance started successfully (status code 200) */ - @ApiOperation( + @Operation( + operationId = "fakeHttpSignatureTest", + summary = "test http signature authentication", tags = { "fake" }, - value = "test http signature authentication", - nickname = "fakeHttpSignatureTest", - notes = "", - authorizations = { - @Authorization(value = "http_signature_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "The instance started successfully") - }) + responses = { + @ApiResponse(responseCode = "200", description = "The instance started successfully") + }, + security = { + @SecurityRequirement(name = "http_signature_test") + } + ) @RequestMapping( method = RequestMethod.GET, value = FakeApi.PATH_FAKE_HTTP_SIGNATURE_TEST, consumes = { "application/json", "application/xml" } ) default ResponseEntity fakeHttpSignatureTest( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid @RequestBody PetDto petDto, - @ApiParam(value = "query parameter") @Valid @RequestParam(value = "query_1", required = false) @Nullable String query1, - @ApiParam(value = "header parameter") @RequestHeader(value = "header_1", required = false) @Nullable String header1 + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @NotNull @Valid @RequestBody PetDto petDto, + @Parameter(name = "query_1", description = "query parameter", in = ParameterIn.QUERY) @Valid @RequestParam(value = "query_1", required = false) @Nullable String query1, + @Parameter(name = "header_1", description = "header parameter", in = ParameterIn.HEADER) @RequestHeader(value = "header_1", required = false) @Nullable String header1 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -169,16 +179,16 @@ default ResponseEntity fakeHttpSignatureTest( * @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, @@ -186,7 +196,7 @@ default ResponseEntity fakeHttpSignatureTest( 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); @@ -201,16 +211,16 @@ default ResponseEntity fakeOuterBooleanSerialize( * @param outerCompositeDto 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 = OuterCompositeDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterCompositeDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, @@ -218,7 +228,7 @@ default ResponseEntity fakeOuterBooleanSerialize( consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto + @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -242,16 +252,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, @@ -259,7 +269,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); @@ -274,16 +284,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, @@ -291,7 +301,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); @@ -306,16 +316,16 @@ default ResponseEntity fakeOuterStringSerialize( * @param outerObjectWithEnumPropertyDto Input enum (int) as post body (required) * @return Output enum (int) (status code 200) */ - @ApiOperation( + @Operation( + operationId = "fakePropertyEnumIntegerSerialize", + description = "Test serialization of enum (int) properties with examples", tags = { "fake" }, - value = "", - nickname = "fakePropertyEnumIntegerSerialize", - notes = "Test serialization of enum (int) properties with examples", - response = OuterObjectWithEnumPropertyDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output enum (int)", response = OuterObjectWithEnumPropertyDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "Output enum (int)", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterObjectWithEnumPropertyDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_FAKE_PROPERTY_ENUM_INTEGER_SERIALIZE, @@ -323,7 +333,7 @@ default ResponseEntity fakeOuterStringSerialize( consumes = { "application/json" } ) default ResponseEntity fakePropertyEnumIntegerSerialize( - @ApiParam(value = "Input enum (int) as post body", required = true) @NotNull @Valid @RequestBody OuterObjectWithEnumPropertyDto outerObjectWithEnumPropertyDto + @Parameter(name = "OuterObjectWithEnumPropertyDto", description = "Input enum (int) as post body", required = true) @NotNull @Valid @RequestBody OuterObjectWithEnumPropertyDto outerObjectWithEnumPropertyDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -347,22 +357,22 @@ default ResponseEntity fakePropertyEnumIntegerSe * @param requestBody request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testAdditionalPropertiesReference", + summary = "test referenced additionalProperties", + description = "", tags = { "fake" }, - value = "test referenced additionalProperties", - nickname = "testAdditionalPropertiesReference", - notes = "" + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_TEST_ADDITIONAL_PROPERTIES_REFERENCE, consumes = { "application/json" } ) default ResponseEntity testAdditionalPropertiesReference( - @ApiParam(value = "request body", required = true) @NotNull @Valid @RequestBody Map requestBody + @Parameter(name = "request_body", description = "request body", required = true) @NotNull @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -377,22 +387,21 @@ default ResponseEntity testAdditionalPropertiesReference( * @param body image to upload (required) * @return Success (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testBodyWithBinary", + description = "For this test, the body has to be a binary file.", tags = { "fake" }, - value = "", - nickname = "testBodyWithBinary", - notes = "For this test, the body has to be a binary file." + responses = { + @ApiResponse(responseCode = "200", description = "Success") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Success") - }) @RequestMapping( method = RequestMethod.PUT, value = FakeApi.PATH_TEST_BODY_WITH_BINARY, consumes = { "image/png" } ) default ResponseEntity testBodyWithBinary( - @ApiParam(value = "image to upload", required = true) @NotNull @Valid @RequestBody org.springframework.core.io.Resource body + @Parameter(name = "body", description = "image to upload", required = true) @NotNull @Valid @RequestBody org.springframework.core.io.Resource body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -407,22 +416,21 @@ default ResponseEntity testBodyWithBinary( * @param fileSchemaTestClassDto (required) * @return Success (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testBodyWithFileSchema", + description = "For this test, the body for this request must reference a schema named `File`.", tags = { "fake" }, - value = "", - nickname = "testBodyWithFileSchema", - notes = "For this test, the body for this request must 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) @NotNull @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto + @Parameter(name = "FileSchemaTestClassDto", description = "", required = true) @NotNull @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -437,23 +445,21 @@ default ResponseEntity testBodyWithFileSchema( * @param userDto (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) @NotNull @Valid @RequestBody UserDto userDto + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "UserDto", description = "", required = true) @NotNull @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -468,16 +474,17 @@ default ResponseEntity testBodyWithQueryParams( * @param clientDto 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 = ClientDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + } + ) @RequestMapping( method = RequestMethod.PATCH, value = FakeApi.PATH_TEST_CLIENT_MODEL, @@ -485,7 +492,7 @@ default ResponseEntity testBodyWithQueryParams( consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -523,39 +530,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) @NotNull @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @NotNull @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @NotNull @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @NotNull @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) @NotNull @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, + @Parameter(name = "double", description = "None", required = true) @NotNull @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) @NotNull @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @Parameter(name = "byte", description = "None", required = true) @NotNull @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); @@ -579,31 +586,31 @@ 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 = "") @Valid @RequestParam(value = "enum_query_model_array", required = false) @Nullable List enumQueryModelArray, - @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_query_model_array", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_model_array", required = false) @Nullable List enumQueryModelArray, + @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); @@ -623,29 +630,29 @@ 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)", - authorizations = { - @Authorization(value = "bearer_test") - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Something wrong") - }) + responses = { + @ApiResponse(responseCode = "400", description = "Something wrong") + }, + security = { + @SecurityRequirement(name = "bearer_test") + } + ) @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); @@ -660,22 +667,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) @NotNull @Valid @RequestBody Map requestBody + @Parameter(name = "request_body", description = "request body", required = true) @NotNull @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -690,22 +697,22 @@ default ResponseEntity testInlineAdditionalProperties( * @param testInlineFreeformAdditionalPropertiesRequestDto request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testInlineFreeformAdditionalProperties", + summary = "test inline free-form additionalProperties", + description = "", tags = { "fake" }, - value = "test inline free-form additionalProperties", - nickname = "testInlineFreeformAdditionalProperties", - notes = "" + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_TEST_INLINE_FREEFORM_ADDITIONAL_PROPERTIES, consumes = { "application/json" } ) default ResponseEntity testInlineFreeformAdditionalProperties( - @ApiParam(value = "request body", required = true) @NotNull @Valid @RequestBody TestInlineFreeformAdditionalPropertiesRequestDto testInlineFreeformAdditionalPropertiesRequestDto + @Parameter(name = "TestInlineFreeformAdditionalPropertiesRequestDto", description = "request body", required = true) @NotNull @Valid @RequestBody TestInlineFreeformAdditionalPropertiesRequestDto testInlineFreeformAdditionalPropertiesRequestDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -721,23 +728,23 @@ default ResponseEntity testInlineFreeformAdditionalProperties( * @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) @NotNull @Valid @RequestParam(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @NotNull @Valid @RequestParam(value = "param2", required = true) String param2 + @Parameter(name = "param", description = "field1", required = true) @NotNull @Valid @RequestParam(value = "param", required = true) String param, + @Parameter(name = "param2", description = "field2", required = true) @NotNull @Valid @RequestParam(value = "param2", required = true) String param2 ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -752,22 +759,22 @@ default ResponseEntity testJsonFormData( * @param childWithNullableDto 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) @NotNull @Valid @RequestBody ChildWithNullableDto childWithNullableDto + @Parameter(name = "ChildWithNullableDto", description = "request body", required = true) @NotNull @Valid @RequestBody ChildWithNullableDto childWithNullableDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -788,27 +795,26 @@ default ResponseEntity testNullable( * @param language (optional) * @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 = "ioutil", required = true) List ioutil, - @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 @ApiParam(value = "", required = true) @Valid @RequestParam(value = "allowEmpty", required = true) String allowEmpty, - @ApiParam(value = "") @Valid @RequestParam(value = "", required = false) @Nullable Map language + @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @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, + @NotNull @Parameter(name = "allowEmpty", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "allowEmpty", required = true) String allowEmpty, + @Parameter(name = "language", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "", required = false) @Nullable Map language ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -823,22 +829,22 @@ default ResponseEntity testQueryParameterCollectionFormat( * @param requestBody request body (required) * @return successful operation (status code 200) */ - @ApiOperation( + @Operation( + operationId = "testStringMapReference", + summary = "test referenced string map", + description = "", tags = { "fake" }, - value = "test referenced string map", - nickname = "testStringMapReference", - notes = "" + responses = { + @ApiResponse(responseCode = "200", description = "successful operation") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_TEST_STRING_MAP_REFERENCE, consumes = { "application/json" } ) default ResponseEntity testStringMapReference( - @ApiParam(value = "request body", required = true) @NotNull @Valid @RequestBody Map requestBody + @Parameter(name = "request_body", description = "request body", required = true) @NotNull @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -855,22 +861,20 @@ default ResponseEntity testStringMapReference( * @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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) - }) @RequestMapping( method = RequestMethod.POST, value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, @@ -878,9 +882,9 @@ default ResponseEntity testStringMapReference( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFileWithRequiredFile( - @NotNull @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 + @NotNull @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-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 64fe63926e4f..51db96a47ca2 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ClientDto; -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 clientDto 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 = ClientDto.class, - authorizations = { - @Authorization(value = "api_key_query") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key_query") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.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) @NotNull @Valid @RequestBody ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java index 6dc72d5883c3..f4d289fcb074 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.FooGetDefaultResponseDto; -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 = "foo", description = "the foo API") +@Tag(name = "foo", description = "the foo API") public interface FooApi { default Optional getRequest() { @@ -37,15 +48,14 @@ default Optional getRequest() { * * @return response (status code 200) */ - @ApiOperation( - value = "", - nickname = "fooGet", - notes = "", - response = FooGetDefaultResponseDto.class + @Operation( + operationId = "fooGet", + responses = { + @ApiResponse(responseCode = "default", description = "response", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = FooGetDefaultResponseDto.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "response", response = FooGetDefaultResponseDto.class) - }) @RequestMapping( method = RequestMethod.GET, value = FooApi.PATH_FOO_GET, diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java index 6dfc227c4d99..c7c180a6ad0e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java @@ -9,7 +9,18 @@ import org.springframework.lang.Nullable; import org.openapitools.model.PetDto; 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) @NotNull @Valid @RequestBody PetDto petDto + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @NotNull @Valid @RequestBody PetDto petDto ) { 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( - @NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey + @NotNull @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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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) @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 ) { 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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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 = PetDto.class, - authorizations = { - @Authorization(value = "api_key") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = PetDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = PetDto.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 = PetDto.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( - @NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + @NotNull @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) @NotNull @Valid @RequestBody PetDto petDto + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @NotNull @Valid @RequestBody PetDto petDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -326,31 +327,28 @@ default ResponseEntity updatePet( * @return Successful operation (status code 200) * or 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 = "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_UPDATE_PET_WITH_FORM, consumes = { "application/x-www-form-urlencoded" } ) default ResponseEntity updatePetWithForm( - @NotNull @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 + @NotNull @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); @@ -367,22 +365,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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) - }) @RequestMapping( method = RequestMethod.POST, value = PetApi.PATH_UPLOAD_FILE, @@ -390,9 +386,9 @@ default ResponseEntity updatePetWithForm( consumes = { "multipart/form-data" } ) default ResponseEntity uploadFile( - @NotNull @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 + @NotNull @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-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java index c748862c9d3e..644e4d0f428b 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,18 @@ import java.util.Map; import org.openapitools.model.OrderDto; -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( - @NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + @NotNull @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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.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( - @NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + @NotNull @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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.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) @NotNull @Valid @RequestBody OrderDto orderDto + @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @NotNull @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java index 51a8e3711719..bcf1768a0364 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,18 @@ import java.time.OffsetDateTime; import org.openapitools.model.UserDto; -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 userDto 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) @NotNull @Valid @RequestBody UserDto userDto + @Parameter(name = "UserDto", description = "Created user object", required = true) @NotNull @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -70,22 +81,22 @@ default ResponseEntity createUser( * @param userDto 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) @NotNull @Valid @RequestBody List<@Valid UserDto> userDto + @Parameter(name = "UserDto", description = "List of user object", required = true) @NotNull @Valid @RequestBody List<@Valid UserDto> userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -100,22 +111,22 @@ default ResponseEntity createUsersWithArrayInput( * @param userDto 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) @NotNull @Valid @RequestBody List<@Valid UserDto> userDto + @Parameter(name = "UserDto", description = "List of user object", required = true) @NotNull @Valid @RequestBody List<@Valid UserDto> userDto ) { 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( - @NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + @NotNull @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 = UserDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = UserDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = UserDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = UserDto.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( - @NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + @NotNull @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( - @NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @NotNull @Valid @RequestBody UserDto userDto + @NotNull @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(name = "UserDto", description = "Updated user object", required = true) @NotNull @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-x-implements-skip/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-x-implements-skip/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..e3091cf746dc --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java @@ -0,0 +1,61 @@ +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") + ) + .addSecuritySchemes("bearer_test", new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("bearer") + .bearerFormat("JWT") + ) + .addSecuritySchemes("http_signature_test", new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .scheme("signature") + ) + ) + ; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot-x-implements-skip/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-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 230713df06f5..1d93aae971a8 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.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.util.HashMap; import java.util.Map; 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.*; @@ -51,7 +50,7 @@ public AdditionalPropertiesClassDto putMapPropertyItem(String key, String mapPro * @return mapProperty */ - @ApiModelProperty(value = "") + @Schema(name = "map_property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_property") public Map getMapProperty() { return mapProperty; @@ -80,7 +79,7 @@ public AdditionalPropertiesClassDto putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java index 7768efea29f8..91754e72a29e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java @@ -6,14 +6,13 @@ 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.SingleRefTypeDto; 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.*; @@ -41,7 +40,7 @@ public AllOfWithSingleRefDto username(@Nullable String username) { * @return username */ - @ApiModelProperty(value = "") + @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") public @Nullable String getUsername() { return username; @@ -62,7 +61,7 @@ public AllOfWithSingleRefDto singleRefType(@Nullable SingleRefTypeDto singleRefT * @return singleRefType */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "SingleRefType", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("SingleRefType") public @Nullable SingleRefTypeDto getSingleRefType() { return singleRefType; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java index bbd7f8cd1cf4..554dc1d02a14 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java @@ -8,13 +8,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; 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.*; @@ -62,7 +61,7 @@ public AnimalDto className(String className) { * @return className */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") public String getClassName() { return className; @@ -83,7 +82,7 @@ public AnimalDto 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-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java index 55edd6c7eb2e..4b69e6c54cc1 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.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.*; @@ -41,7 +40,7 @@ public ApiResponseDto code(@Nullable Integer code) { * @return code */ - @ApiModelProperty(value = "") + @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") public @Nullable Integer getCode() { return code; @@ -62,7 +61,7 @@ public ApiResponseDto type(@Nullable String type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable String getType() { return type; @@ -83,7 +82,7 @@ public ApiResponseDto 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/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 6d8c6c32ffbe..d6ebdee2ba46 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfArrayOfNumberOnlyDto addArrayArrayNumberItem(List arra * @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-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 24c8477e2dc3..f67cc582f15e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfNumberOnlyDto 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-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java index 5a5737e977a3..c44a8b54b152 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -56,7 +55,7 @@ public ArrayTestDto addArrayOfStringItem(String arrayOfStringItem) { * @return arrayOfString */ @Size(min = 0, max = 3) - @ApiModelProperty(value = "") + @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_of_string") public List getArrayOfString() { return arrayOfString; @@ -85,7 +84,7 @@ public ArrayTestDto addArrayArrayOfIntegerItem(List arrayArrayOfIntegerIte * @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; @@ -114,7 +113,7 @@ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> array * @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-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java index 76fa0b0102e7..755e26286420 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.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.*; @@ -47,7 +46,7 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") public @Nullable String getSmallCamel() { return smallCamel; @@ -68,7 +67,7 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") public @Nullable String getCapitalCamel() { return capitalCamel; @@ -89,7 +88,7 @@ public CapitalizationDto 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; @@ -110,7 +109,7 @@ public CapitalizationDto 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; @@ -131,7 +130,7 @@ public CapitalizationDto 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; @@ -152,7 +151,7 @@ public CapitalizationDto 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-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java index 507bad9c4148..82c57f7026bd 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -52,7 +51,7 @@ public CatDto 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-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java index 4b2480586df3..2ff40a01d9e4 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.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.*; @@ -50,7 +49,7 @@ public CategoryDto 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 CategoryDto 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-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 3e1c85442952..72343d2da31f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullableDto; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -45,7 +44,7 @@ public ChildWithNullableDto 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-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java index 1405c5323189..2328451a18f0 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.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 @@ * 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") @JsonTypeName("ClassModel") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ClassModelDto { @@ -38,7 +37,7 @@ public ClassModelDto 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-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java index 5f7a555300d6..f3371d74af20 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.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.*; @@ -37,7 +36,7 @@ public ClientDto 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-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java index 57c450a7b383..2b9e00af7fec 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.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.*; @@ -39,7 +38,7 @@ public DeprecatedObjectDto 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-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java index 538f8de5a685..52a96757a5b4 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -52,7 +51,7 @@ public DogDto 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-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java index 9b9538583b57..9309c9c3fd38 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -6,8 +6,6 @@ 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 java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -114,7 +113,7 @@ public EnumArraysDto 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; @@ -143,7 +142,7 @@ public EnumArraysDto 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-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java index 24bd8c9902d9..6094ebd4b9cd 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java index 2fa70b19cef1..2ecf5fc105d2 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java @@ -6,8 +6,6 @@ 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 java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.OuterEnumDefaultValueDto; @@ -20,6 +18,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -214,7 +213,7 @@ public EnumTestDto 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; @@ -235,7 +234,7 @@ public EnumTestDto 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; @@ -256,7 +255,7 @@ public EnumTestDto 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; @@ -277,7 +276,7 @@ public EnumTestDto 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; @@ -298,7 +297,7 @@ public EnumTestDto outerEnum(OuterEnumDto outerEnum) { * @return outerEnum */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") public JsonNullable getOuterEnum() { return outerEnum; @@ -318,7 +317,7 @@ public EnumTestDto outerEnumInteger(@Nullable OuterEnumIntegerDto outerEnumInteg * @return outerEnumInteger */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnumInteger", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnumInteger") public @Nullable OuterEnumIntegerDto getOuterEnumInteger() { return outerEnumInteger; @@ -339,7 +338,7 @@ public EnumTestDto outerEnumDefaultValue(OuterEnumDefaultValueDto outerEnumDefau * @return outerEnumDefaultValue */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnumDefaultValue", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnumDefaultValue") public OuterEnumDefaultValueDto getOuterEnumDefaultValue() { return outerEnumDefaultValue; @@ -360,7 +359,7 @@ public EnumTestDto outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueDto * @return outerEnumIntegerDefaultValue */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnumIntegerDefaultValue", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnumIntegerDefaultValue") public OuterEnumIntegerDefaultValueDto getOuterEnumIntegerDefaultValue() { return outerEnumIntegerDefaultValue; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java index e0ccf52ed3a7..da1146e32594 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.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.util.HashMap; import java.util.Map; @@ -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.*; @@ -43,7 +42,7 @@ public FakeBigDecimalMap200ResponseDto someId(@Nullable BigDecimal someId) { * @return someId */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "someId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("someId") public @Nullable BigDecimal getSomeId() { return someId; @@ -72,7 +71,7 @@ public FakeBigDecimalMap200ResponseDto putSomeMapItem(String key, BigDecimal som * @return someMap */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "someMap", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("someMap") public Map getSomeMap() { return someMap; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java index 080630c06d61..204027fb6ef1 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.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 @@ * Must be named `File` for test. */ -@ApiModel(description = "Must be named `File` for test.") +@Schema(name = "File", description = "Must be named `File` for test.") @JsonTypeName("File") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class FileDto { @@ -38,7 +37,7 @@ public FileDto 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-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index d6eab2a8876c..315f75b14bb1 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ 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 FileSchemaTestClassDto file(@Nullable FileDto file) { * @return file */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") public @Nullable FileDto getFile() { return file; @@ -73,7 +72,7 @@ public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { * @return files */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") public List<@Valid FileDto> getFiles() { return files; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java index c7d08a3a5ac1..23c5f75f989b 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.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.*; @@ -37,7 +36,7 @@ public FooDto bar(String bar) { * @return bar */ - @ApiModelProperty(value = "") + @Schema(name = "bar", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("bar") public String getBar() { return bar; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java index db428131e31f..4768c4d8f55a 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java @@ -5,14 +5,13 @@ 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.openapitools.model.FooDto; 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.*; @@ -38,7 +37,7 @@ public FooGetDefaultResponseDto string(@Nullable FooDto string) { * @return string */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string") public @Nullable FooDto getString() { return string; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java index 17941d955f5b..b7d953d1fb79 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -91,7 +90,7 @@ public FormatTestDto 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; @@ -114,7 +113,7 @@ public FormatTestDto 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; @@ -135,7 +134,7 @@ public FormatTestDto int64(@Nullable Long int64) { * @return int64 */ - @ApiModelProperty(value = "") + @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") public @Nullable Long getInt64() { return int64; @@ -158,7 +157,7 @@ public FormatTestDto 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; @@ -181,7 +180,7 @@ public FormatTestDto _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; @@ -204,7 +203,7 @@ public FormatTestDto _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; @@ -225,7 +224,7 @@ public FormatTestDto decimal(@Nullable BigDecimal decimal) { * @return decimal */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "decimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("decimal") public @Nullable BigDecimal getDecimal() { return decimal; @@ -246,7 +245,7 @@ public FormatTestDto 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; @@ -267,7 +266,7 @@ public FormatTestDto _byte(byte[] _byte) { * @return _byte */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -288,7 +287,7 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar * @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; @@ -309,7 +308,7 @@ public FormatTestDto 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; @@ -330,7 +329,7 @@ public FormatTestDto 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; @@ -351,7 +350,7 @@ public FormatTestDto 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; @@ -372,7 +371,7 @@ public FormatTestDto 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; @@ -393,7 +392,7 @@ public FormatTestDto patternWithDigits(@Nullable String patternWithDigits) { * @return patternWithDigits */ @Pattern(regexp = "^\\d{10}$") - @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @Schema(name = "pattern_with_digits", description = "A string that is a 10 digit number. Can have leading zeros.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("pattern_with_digits") public @Nullable String getPatternWithDigits() { return patternWithDigits; @@ -414,7 +413,7 @@ public FormatTestDto patternWithDigitsAndDelimiter(@Nullable String patternWithD * @return patternWithDigitsAndDelimiter */ @Pattern(regexp = "/^image_\\d{1,3}$/i") - @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @Schema(name = "pattern_with_digits_and_delimiter", description = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("pattern_with_digits_and_delimiter") public @Nullable String getPatternWithDigitsAndDelimiter() { return patternWithDigitsAndDelimiter; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index f269ad6a33ea..3aa0a3c9b188 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.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.*; @@ -39,7 +38,7 @@ public HasOnlyReadOnlyDto 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; @@ -60,7 +59,7 @@ public HasOnlyReadOnlyDto 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-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java index 2532865c145d..5249f12d0da7 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.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.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -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.*; @@ -24,7 +23,7 @@ * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ -@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@Schema(name = "HealthCheckResult", description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") @JsonTypeName("HealthCheckResult") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class HealthCheckResultDto { @@ -41,7 +40,7 @@ public HealthCheckResultDto nullableMessage(String nullableMessage) { * @return nullableMessage */ - @ApiModelProperty(value = "") + @Schema(name = "NullableMessage", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("NullableMessage") public JsonNullable getNullableMessage() { return nullableMessage; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java index b194fd5f1a20..8d423294883e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.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.*; @@ -37,7 +36,7 @@ public ListDto _123List(@Nullable String _123List) { * @return _123List */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123List() { return _123List; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java index a4760272ba09..e0144d9cad38 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java @@ -6,8 +6,6 @@ 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 java.util.HashMap; import java.util.Map; import org.springframework.lang.Nullable; @@ -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.*; @@ -93,7 +92,7 @@ public MapTestDto putMapMapOfStringItem(String key, Map mapMapOf * @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; @@ -122,7 +121,7 @@ public MapTestDto putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringIt * @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; @@ -151,7 +150,7 @@ public MapTestDto 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; @@ -180,7 +179,7 @@ public MapTestDto putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 17b19984cebe..8757e83c16d5 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -70,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -99,7 +98,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto putMapItem(String key, Ani * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java index d33f33ac5b7c..1fcd887cb0bc 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200ResponseDto { @@ -40,7 +39,7 @@ public Model200ResponseDto name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200ResponseDto 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-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java index a183a9564f05..ea9d9f66ba86 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @JsonTypeName("Name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class NameDto { @@ -55,7 +54,7 @@ public NameDto name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -76,7 +75,7 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -97,7 +96,7 @@ public NameDto property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -118,7 +117,7 @@ public NameDto _123Number(@Nullable Integer _123Number) { * @return _123Number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123Number() { return _123Number; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java index 718d6edbc728..19bd2476c439 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.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; @@ -23,6 +21,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -82,7 +81,7 @@ public NullableClassDto integerProp(Integer integerProp) { * @return integerProp */ - @ApiModelProperty(value = "") + @Schema(name = "integer_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("integer_prop") public JsonNullable getIntegerProp() { return integerProp; @@ -102,7 +101,7 @@ public NullableClassDto numberProp(BigDecimal numberProp) { * @return numberProp */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "number_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("number_prop") public JsonNullable getNumberProp() { return numberProp; @@ -122,7 +121,7 @@ public NullableClassDto booleanProp(Boolean booleanProp) { * @return booleanProp */ - @ApiModelProperty(value = "") + @Schema(name = "boolean_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("boolean_prop") public JsonNullable getBooleanProp() { return booleanProp; @@ -142,7 +141,7 @@ public NullableClassDto stringProp(String stringProp) { * @return stringProp */ - @ApiModelProperty(value = "") + @Schema(name = "string_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("string_prop") public JsonNullable getStringProp() { return stringProp; @@ -162,7 +161,7 @@ public NullableClassDto dateProp(LocalDate dateProp) { * @return dateProp */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "date_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("date_prop") public JsonNullable getDateProp() { return dateProp; @@ -182,7 +181,7 @@ public NullableClassDto datetimeProp(OffsetDateTime datetimeProp) { * @return datetimeProp */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "datetime_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("datetime_prop") public JsonNullable getDatetimeProp() { return datetimeProp; @@ -210,7 +209,7 @@ public NullableClassDto addArrayNullablePropItem(Object arrayNullablePropItem) { * @return arrayNullableProp */ - @ApiModelProperty(value = "") + @Schema(name = "array_nullable_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_nullable_prop") public JsonNullable> getArrayNullableProp() { return arrayNullableProp; @@ -238,7 +237,7 @@ public NullableClassDto addArrayAndItemsNullablePropItem(Object arrayAndItemsNul * @return arrayAndItemsNullableProp */ - @ApiModelProperty(value = "") + @Schema(name = "array_and_items_nullable_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_and_items_nullable_prop") public JsonNullable> getArrayAndItemsNullableProp() { return arrayAndItemsNullableProp; @@ -266,7 +265,7 @@ public NullableClassDto addArrayItemsNullableItem(Object arrayItemsNullableItem) * @return arrayItemsNullable */ - @ApiModelProperty(value = "") + @Schema(name = "array_items_nullable", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("array_items_nullable") public List getArrayItemsNullable() { return arrayItemsNullable; @@ -295,7 +294,7 @@ public NullableClassDto putObjectNullablePropItem(String key, Object objectNulla * @return objectNullableProp */ - @ApiModelProperty(value = "") + @Schema(name = "object_nullable_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("object_nullable_prop") public JsonNullable> getObjectNullableProp() { return objectNullableProp; @@ -323,7 +322,7 @@ public NullableClassDto putObjectAndItemsNullablePropItem(String key, Object obj * @return objectAndItemsNullableProp */ - @ApiModelProperty(value = "") + @Schema(name = "object_and_items_nullable_prop", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("object_and_items_nullable_prop") public JsonNullable> getObjectAndItemsNullableProp() { return objectAndItemsNullableProp; @@ -351,7 +350,7 @@ public NullableClassDto putObjectItemsNullableItem(String key, Object objectItem * @return objectItemsNullable */ - @ApiModelProperty(value = "") + @Schema(name = "object_items_nullable", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("object_items_nullable") public Map getObjectItemsNullable() { return objectItemsNullable; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java index e08766e110d9..af970011d469 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -38,7 +37,7 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java index 1f4ff338b745..741514f15eef 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java @@ -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.util.ArrayList; import java.util.Arrays; @@ -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.*; @@ -52,7 +51,7 @@ public ObjectWithDeprecatedFieldsDto uuid(@Nullable String uuid) { * @return uuid */ - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable String getUuid() { return uuid; @@ -74,7 +73,7 @@ public ObjectWithDeprecatedFieldsDto id(@Nullable BigDecimal id) { * @deprecated */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "id", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @Deprecated @JsonProperty("id") public @Nullable BigDecimal getId() { @@ -101,7 +100,7 @@ public ObjectWithDeprecatedFieldsDto deprecatedRef(@Nullable DeprecatedObjectDto * @deprecated */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "deprecatedRef", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @Deprecated @JsonProperty("deprecatedRef") public @Nullable DeprecatedObjectDto getDeprecatedRef() { @@ -136,7 +135,7 @@ public ObjectWithDeprecatedFieldsDto addBarsItem(String barsItem) { * @deprecated */ - @ApiModelProperty(value = "") + @Schema(name = "bars", deprecated = true, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @Deprecated @JsonProperty("bars") public List getBars() { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java index cf6cd9e8aba1..419b5335e857 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java @@ -6,8 +6,6 @@ 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 java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; @@ -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.*; @@ -88,7 +87,7 @@ public OrderDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -109,7 +108,7 @@ public OrderDto petId(@Nullable Long petId) { * @return petId */ - @ApiModelProperty(value = "") + @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") public @Nullable Long getPetId() { return petId; @@ -130,7 +129,7 @@ public OrderDto quantity(@Nullable Integer quantity) { * @return quantity */ - @ApiModelProperty(value = "") + @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") public @Nullable Integer getQuantity() { return quantity; @@ -151,7 +150,7 @@ public OrderDto 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; @@ -172,7 +171,7 @@ public OrderDto 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; @@ -193,7 +192,7 @@ public OrderDto 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/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java index 7473efd3ef7e..892ac0abe59d 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -42,7 +41,7 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -63,7 +62,7 @@ public OuterCompositeDto myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -84,7 +83,7 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java index be14ce9fcef3..c02e59777678 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java index 5f44668ea3a5..da56b1051d0b 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java index 02c318e1b8fb..071330990ed9 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java index d1a029316220..e758a96b189e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java index df01335eaf57..b8bdd18a7f0f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java @@ -6,14 +6,13 @@ 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.OuterEnumIntegerDto; 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.*; @@ -50,7 +49,7 @@ public OuterObjectWithEnumPropertyDto value(OuterEnumIntegerDto value) { * @return value */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("value") public OuterEnumIntegerDto getValue() { return value; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 4128d2984145..80ffbc926820 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -108,7 +107,7 @@ public ParentWithNullableDto nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java index 89bbd11e2d78..2310b38858e1 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java @@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -21,6 +19,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -107,7 +106,7 @@ public PetDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -128,7 +127,7 @@ public PetDto category(@Nullable CategoryDto category) { * @return category */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") public @Nullable CategoryDto getCategory() { return category; @@ -149,7 +148,7 @@ public PetDto 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; @@ -178,7 +177,7 @@ public PetDto addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -208,7 +207,7 @@ public PetDto addTagsItem(TagDto tagsItem) { * @return tags */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") public List<@Valid TagDto> getTags() { return tags; @@ -229,7 +228,7 @@ public PetDto 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/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 474eaf87c360..6df88518b628 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.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.*; @@ -39,7 +38,7 @@ public ReadOnlyFirstDto 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; @@ -60,7 +59,7 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java index d97190139983..20e809a0f081 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ReturnDto { @@ -38,7 +37,7 @@ public ReturnDto _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java index badd7ed7f2fd..04d47ad05edc 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java @@ -7,6 +7,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-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 742e6fbb25ed..3076794c1652 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.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.*; @@ -37,7 +36,7 @@ public class SpecialModelNameDto { * @return $SpecialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $SpecialPropertyName; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java index 821043b3e6e9..320ef572224e 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.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.*; @@ -39,7 +38,7 @@ public TagDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -60,7 +59,7 @@ public TagDto 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-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java index 3befe5fd6786..662330d40ba0 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.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.*; @@ -41,7 +40,7 @@ public TestInlineFreeformAdditionalPropertiesRequestDto someProperty(@Nullable S * @return someProperty */ - @ApiModelProperty(value = "") + @Schema(name = "someProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("someProperty") public @Nullable String getSomeProperty() { return someProperty; diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java index 689790d2b18a..43e3e24ec599 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.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.*; @@ -51,7 +50,7 @@ public UserDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -72,7 +71,7 @@ public UserDto username(@Nullable String username) { * @return username */ - @ApiModelProperty(value = "") + @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") public @Nullable String getUsername() { return username; @@ -93,7 +92,7 @@ public UserDto firstName(@Nullable String firstName) { * @return firstName */ - @ApiModelProperty(value = "") + @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") public @Nullable String getFirstName() { return firstName; @@ -114,7 +113,7 @@ public UserDto lastName(@Nullable String lastName) { * @return lastName */ - @ApiModelProperty(value = "") + @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") public @Nullable String getLastName() { return lastName; @@ -135,7 +134,7 @@ public UserDto email(@Nullable String email) { * @return email */ - @ApiModelProperty(value = "") + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") public @Nullable String getEmail() { return email; @@ -156,7 +155,7 @@ public UserDto password(@Nullable String password) { * @return password */ - @ApiModelProperty(value = "") + @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") public @Nullable String getPassword() { return password; @@ -177,7 +176,7 @@ public UserDto phone(@Nullable String phone) { * @return phone */ - @ApiModelProperty(value = "") + @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") public @Nullable String getPhone() { return phone; @@ -198,7 +197,7 @@ public UserDto 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/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index bee80ebd189f..cda3767c5400 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.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/AdditionalPropertiesAnyTypeDto.java src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java @@ -64,5 +64,4 @@ src/main/java/org/openapitools/model/UserDto.java src/main/java/org/openapitools/model/XmlItemDto.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/README.md b/samples/server/petstore/springboot/README.md index 6721bbc28ca4..e6de7e038cea 100644 --- a/samples/server/petstore/springboot/README.md +++ b/samples/server/petstore/springboot/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/pom.xml b/samples/server/petstore/springboot/pom.xml index a1b3fc8f0e40..84658573bdf6 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/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/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 5742f5cb6374..51c8f1da6a84 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ClientDto; -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 clientDto 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 = ClientDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.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 ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 6b4cd2e1a754..4969f649abf9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -19,7 +19,18 @@ import org.openapitools.model.ResponseObjectWithDifferentFieldNamesDto; import org.openapitools.model.UserDto; import org.openapitools.model.XmlItemDto; -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 xmlItemDto 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 XmlItemDto xmlItemDto + @Parameter(name = "XmlItemDto", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto ) { 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 outerCompositeDto 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 = OuterCompositeDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "Output composite", content = { + @Content(mediaType = "*/*", schema = @Schema(implementation = OuterCompositeDto.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 OuterCompositeDto outerCompositeDto + @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ) { 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 = ResponseObjectWithDifferentFieldNamesDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ResponseObjectWithDifferentFieldNamesDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseObjectWithDifferentFieldNamesDto.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 responseObjectD * @param fileSchemaTestClassDto (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 FileSchemaTestClassDto fileSchemaTestClassDto + @Parameter(name = "FileSchemaTestClassDto", description = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -288,23 +297,21 @@ default ResponseEntity testBodyWithFileSchema( * @param userDto (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 UserDto userDto + @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, + @Parameter(name = "UserDto", description = "", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -319,16 +326,17 @@ default ResponseEntity testBodyWithQueryParams( * @param clientDto 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 = ClientDto.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) - }) + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.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 ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { 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 childWithNullableDto 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 ChildWithNullableDto childWithNullableDto + @Parameter(name = "ChildWithNullableDto", description = "request body", required = true) @Valid @RequestBody ChildWithNullableDto childWithNullableDto ) { 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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.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/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ff6e96fef9e6..ccb61567ec72 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,18 @@ package org.openapitools.api; import org.openapitools.model.ClientDto; -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 clientDto 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 = ClientDto.class, - authorizations = { - @Authorization(value = "api_key_query") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = ClientDto.class)) + }) + }, + security = { + @SecurityRequirement(name = "api_key_query") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ClientDto.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 ClientDto clientDto + @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index d67a255070ac..9c872ad15550 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -9,7 +9,18 @@ import org.springframework.lang.Nullable; import org.openapitools.model.PetDto; 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 PetDto petDto + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { 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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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 = PetDto.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 = PetDto.class))), + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = PetDto.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 = PetDto.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 = PetDto.class, - authorizations = { - @Authorization(value = "api_key") - } + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = PetDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = PetDto.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 = PetDto.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 PetDto petDto + @Parameter(name = "PetDto", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { 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 = ApiResponseDto.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 = ApiResponseDto.class)) }) - } + }, + security = { + @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.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/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index c593ab30a8ee..d2e9a7212063 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,18 @@ import java.util.Map; import org.openapitools.model.OrderDto; -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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), + @ApiResponse(responseCode = "404", description = "Order not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.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 = OrderDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = OrderDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid Order") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = OrderDto.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 OrderDto orderDto + @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 16adec1deb67..226ef34525ec 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,18 @@ import java.time.OffsetDateTime; import org.openapitools.model.UserDto; -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 userDto 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 UserDto userDto + @Parameter(name = "UserDto", description = "Created user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -70,22 +81,22 @@ default ResponseEntity createUser( * @param userDto 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 UserDto> userDto + @Parameter(name = "UserDto", description = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -100,22 +111,22 @@ default ResponseEntity createUsersWithArrayInput( * @param userDto 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 UserDto> userDto + @Parameter(name = "UserDto", description = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto ) { 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 = UserDto.class + responses = { + @ApiResponse(responseCode = "200", description = "successful operation", content = { + @Content(mediaType = "application/xml", schema = @Schema(implementation = UserDto.class)), + @Content(mediaType = "application/json", schema = @Schema(implementation = UserDto.class)) + }), + @ApiResponse(responseCode = "400", description = "Invalid username supplied"), + @ApiResponse(responseCode = "404", description = "User not found") + } ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = UserDto.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 UserDto userDto + @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, + @Parameter(name = "UserDto", description = "Updated user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java index e390f86f5b73..9aa29284ab5f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot/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/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..a32f1f677870 --- /dev/null +++ b/samples/server/petstore/springboot/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/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java deleted file mode 100644 index fb3561a8f002..000000000000 --- a/samples/server/petstore/springboot/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/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java index cf52b4aed0a0..963a5504f38c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyTypeDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesAnyTypeDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java index e4f9cdb1a71d..b93c9a10cd44 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArrayDto.java @@ -5,14 +5,13 @@ 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.util.List; 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesArrayDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java index 903de0df3da4..9948c04fcb38 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBooleanDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesBooleanDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 306d4eec0e10..7a35f9eaa045 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.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.util.Arrays; import java.util.HashMap; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -80,7 +79,7 @@ public AdditionalPropertiesClassDto putMapStringItem(String key, String mapStrin * @return mapString */ - @ApiModelProperty(value = "") + @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_string") public Map getMapString() { return mapString; @@ -109,7 +108,7 @@ public AdditionalPropertiesClassDto putMapNumberItem(String key, BigDecimal mapN * @return mapNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_number") public Map getMapNumber() { return mapNumber; @@ -138,7 +137,7 @@ public AdditionalPropertiesClassDto putMapIntegerItem(String key, Integer mapInt * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_integer") public Map getMapInteger() { return mapInteger; @@ -167,7 +166,7 @@ public AdditionalPropertiesClassDto putMapBooleanItem(String key, Boolean mapBoo * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map_boolean") public Map getMapBoolean() { return mapBoolean; @@ -196,7 +195,7 @@ public AdditionalPropertiesClassDto putMapArrayIntegerItem(String key, List> getMapArrayInteger() { return mapArrayInteger; @@ -225,7 +224,7 @@ public AdditionalPropertiesClassDto putMapArrayAnytypeItem(String key, List> getMapArrayAnytype() { return mapArrayAnytype; @@ -254,7 +253,7 @@ public AdditionalPropertiesClassDto putMapMapStringItem(String key, Map> getMapMapString() { return mapMapString; @@ -283,7 +282,7 @@ public AdditionalPropertiesClassDto putMapMapAnytypeItem(String key, Map> getMapMapAnytype() { return mapMapAnytype; @@ -304,7 +303,7 @@ public AdditionalPropertiesClassDto 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; @@ -325,7 +324,7 @@ public AdditionalPropertiesClassDto anytype2(Object anytype2) { * @return anytype2 */ - @ApiModelProperty(value = "") + @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("anytype_2") public JsonNullable getAnytype2() { return anytype2; @@ -345,7 +344,7 @@ public AdditionalPropertiesClassDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java index df611cb49ab5..30a80ec7e6ad 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesIntegerDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesIntegerDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java index b66b9c9eb0a3..2ae84c9d12e5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesNumberDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesNumberDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java index d26b21fb6804..1c0211f822d6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesObjectDto.java @@ -5,14 +5,13 @@ 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.util.Map; 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.*; @@ -42,7 +41,7 @@ public AdditionalPropertiesObjectDto 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/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java index 43f2eff5a64d..36a45be2a322 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesStringDto.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.*; @@ -41,7 +40,7 @@ public AdditionalPropertiesStringDto 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/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java index 99e203af7716..4d51394ed42c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalDto.java @@ -8,13 +8,12 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; 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.*; @@ -63,7 +62,7 @@ public AnimalDto className(String className) { * @return className */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("className") public String getClassName() { return className; @@ -84,7 +83,7 @@ public AnimalDto 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/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java index 55edd6c7eb2e..4b69e6c54cc1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ApiResponseDto.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.*; @@ -41,7 +40,7 @@ public ApiResponseDto code(@Nullable Integer code) { * @return code */ - @ApiModelProperty(value = "") + @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("code") public @Nullable Integer getCode() { return code; @@ -62,7 +61,7 @@ public ApiResponseDto type(@Nullable String type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable String getType() { return type; @@ -83,7 +82,7 @@ public ApiResponseDto 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/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 6d8c6c32ffbe..d6ebdee2ba46 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfArrayOfNumberOnlyDto addArrayArrayNumberItem(List arra * @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/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 24c8477e2dc3..f67cc582f15e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ 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 ArrayOfNumberOnlyDto 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/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java index 9d02a230bbb9..429a2f78cf3a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -56,7 +55,7 @@ public ArrayTestDto 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; @@ -85,7 +84,7 @@ public ArrayTestDto addArrayArrayOfIntegerItem(List arrayArrayOfIntegerIte * @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; @@ -114,7 +113,7 @@ public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> array * @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/src/main/java/org/openapitools/model/BigCatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java deleted file mode 100644 index 546ab564a99b..000000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOfDto.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -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.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOfDto - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOfDto { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private KindEnum kind; - - public BigCatAllOfDto kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @ApiModelProperty(value = "") - @JsonProperty("kind") - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOfDto bigCatAllOf = (BigCatAllOfDto) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOfDto {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java index 7f15ba3ba834..4edd7940033f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatDto.java @@ -9,14 +9,13 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; 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.CatDto; 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.*; @@ -93,7 +92,7 @@ public BigCatDto 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/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java index 76fa0b0102e7..755e26286420 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CapitalizationDto.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.*; @@ -47,7 +46,7 @@ public CapitalizationDto smallCamel(@Nullable String smallCamel) { * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("smallCamel") public @Nullable String getSmallCamel() { return smallCamel; @@ -68,7 +67,7 @@ public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("CapitalCamel") public @Nullable String getCapitalCamel() { return capitalCamel; @@ -89,7 +88,7 @@ public CapitalizationDto 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; @@ -110,7 +109,7 @@ public CapitalizationDto 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; @@ -131,7 +130,7 @@ public CapitalizationDto 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; @@ -152,7 +151,7 @@ public CapitalizationDto 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/src/main/java/org/openapitools/model/CatAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java deleted file mode 100644 index 5381c543ba35..000000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOfDto.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOfDto - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOfDto { - - private Boolean declawed; - - public CatAllOfDto declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @ApiModelProperty(value = "") - @JsonProperty("declawed") - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOfDto catAllOf = (CatAllOfDto) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOfDto {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java index 7a9284f34aaa..f79ed223a79c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -60,7 +59,7 @@ public CatDto 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/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java index 4b2480586df3..2ff40a01d9e4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CategoryDto.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.*; @@ -50,7 +49,7 @@ public CategoryDto 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 CategoryDto 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/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java index 3e1c85442952..72343d2da31f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.ParentWithNullableDto; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -45,7 +44,7 @@ public ChildWithNullableDto 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/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java index 1405c5323189..2328451a18f0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModelDto.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 @@ * 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") @JsonTypeName("ClassModel") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ClassModelDto { @@ -38,7 +37,7 @@ public ClassModelDto 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/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java index 5f7a555300d6..f3371d74af20 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClientDto.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.*; @@ -37,7 +36,7 @@ public ClientDto 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/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java index 192c0533e805..cb8fc7cb286c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.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.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.*; @@ -72,7 +71,7 @@ public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { * @return nullableArray */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array") public JsonNullable> getNullableArray() { return nullableArray; @@ -100,7 +99,7 @@ public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequ * @return nullableRequiredArray */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("nullable_required_array") public JsonNullable> getNullableRequiredArray() { return nullableRequiredArray; @@ -129,7 +128,7 @@ public ContainerDefaultValueDto 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; @@ -158,7 +157,7 @@ public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableA * @return nullableArrayWithDefault */ - @ApiModelProperty(value = "") + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullable_array_with_default") public JsonNullable> getNullableArrayWithDefault() { return nullableArrayWithDefault; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java deleted file mode 100644 index d855ccb5e826..000000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOfDto.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -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.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOfDto - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOfDto { - - private String breed; - - public DogAllOfDto breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @ApiModelProperty(value = "") - @JsonProperty("breed") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOfDto dogAllOf = (DogAllOfDto) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOfDto {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java index b7a132b395d6..483f257fedc5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogDto.java @@ -8,14 +8,13 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.AnimalDto; 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.*; @@ -53,7 +52,7 @@ public DogDto 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/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java index 9b9538583b57..9309c9c3fd38 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -6,8 +6,6 @@ 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 java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -114,7 +113,7 @@ public EnumArraysDto 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; @@ -143,7 +142,7 @@ public EnumArraysDto 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/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java index 24bd8c9902d9..6094ebd4b9cd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClassDto.java @@ -7,6 +7,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/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java index ec99d5715c97..f06912058f85 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTestDto.java @@ -6,14 +6,13 @@ 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.OuterEnumDto; 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.*; @@ -202,7 +201,7 @@ public EnumTestDto 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; @@ -223,7 +222,7 @@ public EnumTestDto 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; @@ -244,7 +243,7 @@ public EnumTestDto 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; @@ -265,7 +264,7 @@ public EnumTestDto 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; @@ -286,7 +285,7 @@ public EnumTestDto outerEnum(@Nullable OuterEnumDto outerEnum) { * @return outerEnum */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("outerEnum") public @Nullable OuterEnumDto getOuterEnum() { return outerEnum; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java index 080630c06d61..204027fb6ef1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileDto.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 @@ * Must be named `File` for test. */ -@ApiModel(description = "Must be named `File` for test.") +@Schema(name = "File", description = "Must be named `File` for test.") @JsonTypeName("File") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class FileDto { @@ -38,7 +37,7 @@ public FileDto 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/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index d6eab2a8876c..315f75b14bb1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.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.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -16,6 +14,7 @@ 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 FileSchemaTestClassDto file(@Nullable FileDto file) { * @return file */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("file") public @Nullable FileDto getFile() { return file; @@ -73,7 +72,7 @@ public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { * @return files */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("files") public List<@Valid FileDto> getFiles() { return files; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java index f36bca743590..151ecac3a6aa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTestDto.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; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public FormatTestDto 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; @@ -110,7 +109,7 @@ public FormatTestDto 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; @@ -131,7 +130,7 @@ public FormatTestDto int64(@Nullable Long int64) { * @return int64 */ - @ApiModelProperty(value = "") + @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("int64") public @Nullable Long getInt64() { return int64; @@ -154,7 +153,7 @@ public FormatTestDto 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; @@ -177,7 +176,7 @@ public FormatTestDto _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; @@ -200,7 +199,7 @@ public FormatTestDto _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; @@ -221,7 +220,7 @@ public FormatTestDto 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; @@ -242,7 +241,7 @@ public FormatTestDto _byte(byte[] _byte) { * @return _byte */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("byte") public byte[] getByte() { return _byte; @@ -263,7 +262,7 @@ public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binar * @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; @@ -284,7 +283,7 @@ public FormatTestDto 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; @@ -305,7 +304,7 @@ public FormatTestDto 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; @@ -326,7 +325,7 @@ public FormatTestDto 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; @@ -347,7 +346,7 @@ public FormatTestDto 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; @@ -368,7 +367,7 @@ public FormatTestDto 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/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java index f269ad6a33ea..3aa0a3c9b188 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.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.*; @@ -39,7 +38,7 @@ public HasOnlyReadOnlyDto 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; @@ -60,7 +59,7 @@ public HasOnlyReadOnlyDto 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/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java index b194fd5f1a20..8d423294883e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ListDto.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.*; @@ -37,7 +36,7 @@ public ListDto _123List(@Nullable String _123List) { * @return _123List */ - @ApiModelProperty(value = "") + @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123-list") public @Nullable String get123List() { return _123List; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java index a4760272ba09..e0144d9cad38 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java @@ -6,8 +6,6 @@ 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 java.util.HashMap; import java.util.Map; import org.springframework.lang.Nullable; @@ -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.*; @@ -93,7 +92,7 @@ public MapTestDto putMapMapOfStringItem(String key, Map mapMapOf * @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; @@ -122,7 +121,7 @@ public MapTestDto putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringIt * @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; @@ -151,7 +150,7 @@ public MapTestDto 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; @@ -180,7 +179,7 @@ public MapTestDto putIndirectMapItem(String key, Boolean indirectMapItem) { * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("indirect_map") public Map getIndirectMap() { return indirectMap; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 17b19984cebe..8757e83c16d5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.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.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -18,6 +16,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -49,7 +48,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) * @return uuid */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("uuid") public @Nullable UUID getUuid() { return uuid; @@ -70,7 +69,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetD * @return dateTime */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("dateTime") public @Nullable OffsetDateTime getDateTime() { return dateTime; @@ -99,7 +98,7 @@ public MixedPropertiesAndAdditionalPropertiesClassDto putMapItem(String key, Ani * @return map */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("map") public Map getMap() { return map; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java index d33f33ac5b7c..1fcd887cb0bc 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200ResponseDto.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 @@ * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(name = "200_response", description = "Model for testing model name starting with number") @JsonTypeName("200_response") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class Model200ResponseDto { @@ -40,7 +39,7 @@ public Model200ResponseDto name(@Nullable Integer name) { * @return name */ - @ApiModelProperty(value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name") public @Nullable Integer getName() { return name; @@ -61,7 +60,7 @@ public Model200ResponseDto 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/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java index a183a9564f05..ea9d9f66ba86 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NameDto.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 @@ * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(name = "Name", description = "Model for testing model name same as property name") @JsonTypeName("Name") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class NameDto { @@ -55,7 +54,7 @@ public NameDto name(Integer name) { * @return name */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("name") public Integer getName() { return name; @@ -76,7 +75,7 @@ public NameDto snakeCase(@Nullable Integer snakeCase) { * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("snake_case") public @Nullable Integer getSnakeCase() { return snakeCase; @@ -97,7 +96,7 @@ public NameDto property(@Nullable String property) { * @return property */ - @ApiModelProperty(value = "") + @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property") public @Nullable String getProperty() { return property; @@ -118,7 +117,7 @@ public NameDto _123Number(@Nullable Integer _123Number) { * @return _123Number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("123Number") public @Nullable Integer get123Number() { return _123Number; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java index 6be04c42bc2d..4f0869153de5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NullableMapPropertyDto.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.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -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.*; @@ -51,7 +50,7 @@ public NullableMapPropertyDto putLanguageValuesItem(String key, String languageV * @return languageValues */ - @ApiModelProperty(value = "") + @Schema(name = "languageValues", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("languageValues") public JsonNullable> getLanguageValues() { return languageValues; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java index e08766e110d9..af970011d469 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -38,7 +37,7 @@ public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { * @return justNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("JustNumber") public @Nullable BigDecimal getJustNumber() { return justNumber; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java index cf6cd9e8aba1..419b5335e857 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OrderDto.java @@ -6,8 +6,6 @@ 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 java.time.OffsetDateTime; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.lang.Nullable; @@ -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.*; @@ -88,7 +87,7 @@ public OrderDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -109,7 +108,7 @@ public OrderDto petId(@Nullable Long petId) { * @return petId */ - @ApiModelProperty(value = "") + @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("petId") public @Nullable Long getPetId() { return petId; @@ -130,7 +129,7 @@ public OrderDto quantity(@Nullable Integer quantity) { * @return quantity */ - @ApiModelProperty(value = "") + @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("quantity") public @Nullable Integer getQuantity() { return quantity; @@ -151,7 +150,7 @@ public OrderDto 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; @@ -172,7 +171,7 @@ public OrderDto 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; @@ -193,7 +192,7 @@ public OrderDto 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/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java index 7473efd3ef7e..892ac0abe59d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -5,14 +5,13 @@ 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 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.*; @@ -42,7 +41,7 @@ public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { * @return myNumber */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_number") public @Nullable BigDecimal getMyNumber() { return myNumber; @@ -63,7 +62,7 @@ public OuterCompositeDto myString(@Nullable String myString) { * @return myString */ - @ApiModelProperty(value = "") + @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_string") public @Nullable String getMyString() { return myString; @@ -84,7 +83,7 @@ public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("my_boolean") public @Nullable Boolean getMyBoolean() { return myBoolean; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java index e00345898bb9..7a02d8db757b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -7,6 +7,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/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java index 4128d2984145..80ffbc926820 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -9,8 +9,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.Arrays; import org.openapitools.jackson.nullable.JsonNullable; import org.springframework.lang.Nullable; @@ -19,6 +17,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -87,7 +86,7 @@ public ParentWithNullableDto type(@Nullable TypeEnum type) { * @return type */ - @ApiModelProperty(value = "") + @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("type") public @Nullable TypeEnum getType() { return type; @@ -108,7 +107,7 @@ public ParentWithNullableDto nullableProperty(String nullableProperty) { * @return nullableProperty */ - @ApiModelProperty(value = "") + @Schema(name = "nullableProperty", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("nullableProperty") public JsonNullable getNullableProperty() { return nullableProperty; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 28a51738ca2d..b1c6d72d3006 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashSet; @@ -21,6 +19,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -108,7 +107,7 @@ public PetDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -129,7 +128,7 @@ public PetDto category(@Nullable CategoryDto category) { * @return category */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("category") public @Nullable CategoryDto getCategory() { return category; @@ -150,7 +149,7 @@ public PetDto 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; @@ -179,7 +178,7 @@ public PetDto addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("photoUrls") public Set getPhotoUrls() { return photoUrls; @@ -209,7 +208,7 @@ public PetDto addTagsItem(TagDto tagsItem) { * @return tags */ @Valid - @ApiModelProperty(value = "") + @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("tags") public List<@Valid TagDto> getTags() { return tags; @@ -231,7 +230,7 @@ public PetDto 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/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java index 474eaf87c360..6df88518b628 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirstDto.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.*; @@ -39,7 +38,7 @@ public ReadOnlyFirstDto 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; @@ -60,7 +59,7 @@ public ReadOnlyFirstDto baz(@Nullable String baz) { * @return baz */ - @ApiModelProperty(value = "") + @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("baz") public @Nullable String getBaz() { return baz; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java index c9bb2b32de7f..333a898ed88d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNamesDto.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.*; @@ -43,7 +42,7 @@ public ResponseObjectWithDifferentFieldNamesDto normalPropertyName(@Nullable Str * @return normalPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "normalPropertyName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("normalPropertyName") public @Nullable String getNormalPropertyName() { return normalPropertyName; @@ -64,7 +63,7 @@ public ResponseObjectWithDifferentFieldNamesDto UPPER_CASE_PROPERTY_SNAKE(@Nulla * @return UPPER_CASE_PROPERTY_SNAKE */ - @ApiModelProperty(value = "") + @Schema(name = "UPPER_CASE_PROPERTY_SNAKE", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("UPPER_CASE_PROPERTY_SNAKE") public @Nullable String getUPPERCASEPROPERTYSNAKE() { return UPPER_CASE_PROPERTY_SNAKE; @@ -85,7 +84,7 @@ public ResponseObjectWithDifferentFieldNamesDto lowerCasePropertyDashes(@Nullabl * @return lowerCasePropertyDashes */ - @ApiModelProperty(value = "") + @Schema(name = "lower-case-property-dashes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lower-case-property-dashes") public @Nullable String getLowerCasePropertyDashes() { return lowerCasePropertyDashes; @@ -106,7 +105,7 @@ public ResponseObjectWithDifferentFieldNamesDto propertyNameWithSpaces(@Nullable * @return propertyNameWithSpaces */ - @ApiModelProperty(value = "") + @Schema(name = "property name with spaces", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("property name with spaces") public @Nullable String getPropertyNameWithSpaces() { return propertyNameWithSpaces; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java index d97190139983..20e809a0f081 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReturnDto.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 @@ * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(name = "Return", description = "Model for testing reserved words") @JsonTypeName("Return") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.21.0-SNAPSHOT") public class ReturnDto { @@ -38,7 +37,7 @@ public ReturnDto _return(@Nullable Integer _return) { * @return _return */ - @ApiModelProperty(value = "") + @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("return") public @Nullable Integer getReturn() { return _return; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 742e6fbb25ed..3076794c1652 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.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.*; @@ -37,7 +36,7 @@ public class SpecialModelNameDto { * @return $SpecialPropertyName */ - @ApiModelProperty(value = "") + @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("$special[property.name]") public @Nullable Long get$SpecialPropertyName() { return $SpecialPropertyName; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java index 821043b3e6e9..320ef572224e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TagDto.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.*; @@ -39,7 +38,7 @@ public TagDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -60,7 +59,7 @@ public TagDto 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/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index df7cfb007dd3..9fae3543ea0b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -65,7 +64,7 @@ public TypeHolderDefaultDto stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -86,7 +85,7 @@ public TypeHolderDefaultDto numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(required = true, value = "") + @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -107,7 +106,7 @@ public TypeHolderDefaultDto integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -128,7 +127,7 @@ public TypeHolderDefaultDto boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -157,7 +156,7 @@ public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(required = true, value = "") + @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 0cbea4f3b99b..2f3a861e5588 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -68,7 +67,7 @@ public TypeHolderExampleDto stringItem(String stringItem) { * @return stringItem */ @NotNull - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("string_item") public String getStringItem() { return stringItem; @@ -89,7 +88,7 @@ public TypeHolderExampleDto numberItem(BigDecimal numberItem) { * @return numberItem */ @NotNull @Valid - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("number_item") public BigDecimal getNumberItem() { return numberItem; @@ -110,7 +109,7 @@ public TypeHolderExampleDto floatItem(Float floatItem) { * @return floatItem */ @NotNull - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("float_item") public Float getFloatItem() { return floatItem; @@ -131,7 +130,7 @@ public TypeHolderExampleDto integerItem(Integer integerItem) { * @return integerItem */ @NotNull - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("integer_item") public Integer getIntegerItem() { return integerItem; @@ -152,7 +151,7 @@ public TypeHolderExampleDto boolItem(Boolean boolItem) { * @return boolItem */ @NotNull - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("bool_item") public Boolean getBoolItem() { return boolItem; @@ -181,7 +180,7 @@ public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("array_item") public List getArrayItem() { return arrayItem; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java index 689790d2b18a..43e3e24ec599 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/UserDto.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.*; @@ -51,7 +50,7 @@ public UserDto id(@Nullable Long id) { * @return id */ - @ApiModelProperty(value = "") + @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("id") public @Nullable Long getId() { return id; @@ -72,7 +71,7 @@ public UserDto username(@Nullable String username) { * @return username */ - @ApiModelProperty(value = "") + @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("username") public @Nullable String getUsername() { return username; @@ -93,7 +92,7 @@ public UserDto firstName(@Nullable String firstName) { * @return firstName */ - @ApiModelProperty(value = "") + @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("firstName") public @Nullable String getFirstName() { return firstName; @@ -114,7 +113,7 @@ public UserDto lastName(@Nullable String lastName) { * @return lastName */ - @ApiModelProperty(value = "") + @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("lastName") public @Nullable String getLastName() { return lastName; @@ -135,7 +134,7 @@ public UserDto email(@Nullable String email) { * @return email */ - @ApiModelProperty(value = "") + @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("email") public @Nullable String getEmail() { return email; @@ -156,7 +155,7 @@ public UserDto password(@Nullable String password) { * @return password */ - @ApiModelProperty(value = "") + @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("password") public @Nullable String getPassword() { return password; @@ -177,7 +176,7 @@ public UserDto phone(@Nullable String phone) { * @return phone */ - @ApiModelProperty(value = "") + @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("phone") public @Nullable String getPhone() { return phone; @@ -198,7 +197,7 @@ public UserDto 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/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java index 8b9f4634ab67..145ec198bcef 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.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.util.ArrayList; import java.util.Arrays; @@ -16,6 +14,7 @@ import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; import java.util.*; @@ -106,7 +105,7 @@ public XmlItemDto attributeString(@Nullable String attributeString) { * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_string") public @Nullable String getAttributeString() { return attributeString; @@ -127,7 +126,7 @@ public XmlItemDto attributeNumber(@Nullable BigDecimal attributeNumber) { * @return attributeNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_number") public @Nullable BigDecimal getAttributeNumber() { return attributeNumber; @@ -148,7 +147,7 @@ public XmlItemDto attributeInteger(@Nullable Integer attributeInteger) { * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_integer") public @Nullable Integer getAttributeInteger() { return attributeInteger; @@ -169,7 +168,7 @@ public XmlItemDto attributeBoolean(@Nullable Boolean attributeBoolean) { * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("attribute_boolean") public @Nullable Boolean getAttributeBoolean() { return attributeBoolean; @@ -198,7 +197,7 @@ public XmlItemDto addWrappedArrayItem(Integer wrappedArrayItem) { * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("wrapped_array") public List getWrappedArray() { return wrappedArray; @@ -219,7 +218,7 @@ public XmlItemDto nameString(@Nullable String nameString) { * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_string") public @Nullable String getNameString() { return nameString; @@ -240,7 +239,7 @@ public XmlItemDto nameNumber(@Nullable BigDecimal nameNumber) { * @return nameNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_number") public @Nullable BigDecimal getNameNumber() { return nameNumber; @@ -261,7 +260,7 @@ public XmlItemDto nameInteger(@Nullable Integer nameInteger) { * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_integer") public @Nullable Integer getNameInteger() { return nameInteger; @@ -282,7 +281,7 @@ public XmlItemDto nameBoolean(@Nullable Boolean nameBoolean) { * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_boolean") public @Nullable Boolean getNameBoolean() { return nameBoolean; @@ -311,7 +310,7 @@ public XmlItemDto addNameArrayItem(Integer nameArrayItem) { * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_array") public List getNameArray() { return nameArray; @@ -340,7 +339,7 @@ public XmlItemDto addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { return nameWrappedArray; @@ -361,7 +360,7 @@ public XmlItemDto prefixString(@Nullable String prefixString) { * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_string") public @Nullable String getPrefixString() { return prefixString; @@ -382,7 +381,7 @@ public XmlItemDto prefixNumber(@Nullable BigDecimal prefixNumber) { * @return prefixNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_number") public @Nullable BigDecimal getPrefixNumber() { return prefixNumber; @@ -403,7 +402,7 @@ public XmlItemDto prefixInteger(@Nullable Integer prefixInteger) { * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_integer") public @Nullable Integer getPrefixInteger() { return prefixInteger; @@ -424,7 +423,7 @@ public XmlItemDto prefixBoolean(@Nullable Boolean prefixBoolean) { * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_boolean") public @Nullable Boolean getPrefixBoolean() { return prefixBoolean; @@ -453,7 +452,7 @@ public XmlItemDto addPrefixArrayItem(Integer prefixArrayItem) { * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_array") public List getPrefixArray() { return prefixArray; @@ -482,7 +481,7 @@ public XmlItemDto addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { return prefixWrappedArray; @@ -503,7 +502,7 @@ public XmlItemDto namespaceString(@Nullable String namespaceString) { * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_string") public @Nullable String getNamespaceString() { return namespaceString; @@ -524,7 +523,7 @@ public XmlItemDto namespaceNumber(@Nullable BigDecimal namespaceNumber) { * @return namespaceNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_number") public @Nullable BigDecimal getNamespaceNumber() { return namespaceNumber; @@ -545,7 +544,7 @@ public XmlItemDto namespaceInteger(@Nullable Integer namespaceInteger) { * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_integer") public @Nullable Integer getNamespaceInteger() { return namespaceInteger; @@ -566,7 +565,7 @@ public XmlItemDto namespaceBoolean(@Nullable Boolean namespaceBoolean) { * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_boolean") public @Nullable Boolean getNamespaceBoolean() { return namespaceBoolean; @@ -595,7 +594,7 @@ public XmlItemDto addNamespaceArrayItem(Integer namespaceArrayItem) { * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_array") public List getNamespaceArray() { return namespaceArray; @@ -624,7 +623,7 @@ public XmlItemDto addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { return namespaceWrappedArray; @@ -645,7 +644,7 @@ public XmlItemDto prefixNsString(@Nullable String prefixNsString) { * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_string") public @Nullable String getPrefixNsString() { return prefixNsString; @@ -666,7 +665,7 @@ public XmlItemDto prefixNsNumber(@Nullable BigDecimal prefixNsNumber) { * @return prefixNsNumber */ @Valid - @ApiModelProperty(example = "1.234", value = "") + @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_number") public @Nullable BigDecimal getPrefixNsNumber() { return prefixNsNumber; @@ -687,7 +686,7 @@ public XmlItemDto prefixNsInteger(@Nullable Integer prefixNsInteger) { * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_integer") public @Nullable Integer getPrefixNsInteger() { return prefixNsInteger; @@ -708,7 +707,7 @@ public XmlItemDto prefixNsBoolean(@Nullable Boolean prefixNsBoolean) { * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_boolean") public @Nullable Boolean getPrefixNsBoolean() { return prefixNsBoolean; @@ -737,7 +736,7 @@ public XmlItemDto addPrefixNsArrayItem(Integer prefixNsArrayItem) { * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { return prefixNsArray; @@ -766,7 +765,7 @@ public XmlItemDto addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { return prefixNsWrappedArray;