From 70f22421495f25d308124570906aa262c96a73c5 Mon Sep 17 00:00:00 2001 From: Alexej Date: Sat, 7 Mar 2020 20:03:50 +0100 Subject: [PATCH 1/5] Fix OpenAPITools#4245 changed mustaches in spring libs to use it with io.swagger.core.v3 in version 2.1.1 deleted import of old ApiModel and ApiModelProperty in spring libs, io.swagger.core.v3 in version 2.1.1 will be used instead --- .../codegen/languages/SpringCodegen.java | 10 ++++++++ .../main/resources/JavaSpring/api.mustache | 24 +++++++++---------- .../JavaSpring/apiController.mustache | 4 +++- .../resources/JavaSpring/apiDelegate.mustache | 3 ++- .../resources/JavaSpring/bodyParams.mustache | 2 +- .../resources/JavaSpring/formParams.mustache | 2 +- .../JavaSpring/headerParams.mustache | 2 +- .../libraries/spring-boot/pom.mustache | 11 +++++---- .../spring-cloud/formParams.mustache | 2 +- .../libraries/spring-cloud/pom.mustache | 4 ++-- .../libraries/spring-mvc/pom.mustache | 9 +++++-- .../main/resources/JavaSpring/model.mustache | 1 + .../resources/JavaSpring/pathParams.mustache | 2 +- .../main/resources/JavaSpring/pojo.mustache | 4 ++-- .../resources/JavaSpring/queryParams.mustache | 2 +- 15 files changed, 51 insertions(+), 31 deletions(-) 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 8450fbd5f4de..a0cd2b6ccae4 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.lang3.tuple.Pair; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.features.BeanValidationFeatures; @@ -820,6 +821,15 @@ public void setUnhandledException(boolean unhandledException) { this.unhandledException = unhandledException; } + @Override + public CodegenModel fromModel(String name, Schema model) { + CodegenModel codegenModel = super.fromModel(name, model); + // Remove io.swagger.annotations.ApiModel import + codegenModel.imports.remove("ApiModel"); + codegenModel.imports.remove("ApiModelProperty"); + return codegenModel; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index a5457e2a9c10..7b6aee3a1286 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -7,7 +7,12 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; {{#jdk8-no-delegate}} {{#virtualService}} import io.virtualan.annotation.ApiVirtual; @@ -61,7 +66,7 @@ import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture {{#useBeanValidation}} @Validated {{/useBeanValidation}} -@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") +@Tag(name = "{{{baseName}}}", description = "the {{{baseName}}} API") {{#operations}} {{#virtualService}} @VirtualService @@ -107,16 +112,11 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} - @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { - {{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { - {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}}, - {{/hasMore}}{{/scopes}} - }{{/isOAuth}}){{#hasMore}}, - {{/hasMore}}{{/authMethods}} - }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) - @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) - {{#implicitHeaders}} + @Operation(summary = "{{{summary}}}", description = "{{{notes}}}", + tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }, + responses = { {{#responses}} + @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}" {{#baseType}}, content = { @Content( {{#containerType}}schema = @Schema(implementation = {{{baseType}}}.class){{/containerType}}{{^containerType}} array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class)) {{/containerType}} )} {{/baseType}} ){{#hasMore}} ,{{/hasMore}} {{/responses}} }) + {{#implicitHeaders}}} @ApiImplicitParams({ {{#headerParams}} {{>implicitHeader}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache index 66727f4c6460..d1a6eabfdf18 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache @@ -3,7 +3,9 @@ package {{package}}; {{^jdk8}} {{#imports}}import {{import}}; {{/imports}} -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index e93ba0a69d33..042172e10bba 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -2,7 +2,8 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; {{#jdk8}} import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache index c2a1faa8c9fb..6daedb591da9 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index 1f4a1b2395af..bbf0ca3bfab9 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestPart(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@Parameter(description = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}},schema = @Schema(allowableValues ={"{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"}){{/allowableValues}}{{^isContainer}}{{#defaultValue}}, example={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestPart(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@Parameter(description = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index a8bbef330c8a..33756007d972 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@Parameter(in = ParameterIn.HEADER, description = "{{{description}}}" {{#required}} ,required=true{{/required}} {{#allowableValues}}, schema = @Schema(allowableValues={"{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"}{{^isContainer}}{{#defaultValue}}, example={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/allowableValues}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index e3cf4da32171..fb672e32205c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -11,6 +11,7 @@ ${java.version} {{#useSpringfox}} 2.8.0 + 2.1.1 {{/useSpringfox}} {{#parentOverridden}} @@ -94,6 +95,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api @@ -106,11 +112,6 @@ swagger-ui 3.14.2 - - io.swagger - swagger-annotations - 1.5.14 - com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index 13a6e56e14b5..9eede58875ce 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@Parameter({{#allowableValues}} schema = @Schema( allowableValues="{{{allowableValues}}}"), {{/allowableValues}} description = "{{{description}}}"{{#required}}, required=true{{/required}} {{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@Parameter(description = "{{{description}}}") @RequestParam("{{baseName}}") {{#isListContainer}}List<{{/isListContainer}}MultipartFile{{#isListContainer}}>{{/isListContainer}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index 06de2c6fcbc5..d91f218e703a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -9,7 +9,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 2.1.1 {{#parentOverridden}} @@ -45,7 +45,7 @@ {{/parentOverridden}} - io.swagger + io.swagger.core.v3 swagger-annotations {{^parentOverridden}} ${swagger-core-version} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index c0abd27f2058..69e8c02e88b3 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -165,6 +165,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + 2.1.1 + {{/useSpringfox}} {{^useSpringfox}} @@ -173,9 +178,9 @@ 3.14.2 - io.swagger + io.swagger.core.v3 swagger-annotations - 1.5.14 + 2.1.1 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache index fbe3a9f1445d..8ee9de69becf 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/model.mustache @@ -3,6 +3,7 @@ package {{package}}; import java.util.Objects; {{#imports}}import {{import}}; {{/imports}} +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; {{#serializableModel}} import java.io.Serializable; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index d3c16fab5f1c..f963a23142d3 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@Parameter(in = ParameterIn.PATH,description = "{{{description}}}", {{#required}}required=true{{/required}}{{#allowableValues}} schema = @Schema( allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"){{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 695e865a71ae..1a52f9927a57 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -1,7 +1,7 @@ /** * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@Schema(description = "{{{description}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{>additionalModelTypeAnnotations}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} @@ -83,7 +83,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") + @Schema({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 0f79dd06de5f..74925c0f6f34 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMapContainer}}""{{/isMapContainer}}{{^isMapContainer}}"{{baseName}}"{{/isMapContainer}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@Parameter(schema = @Schema({{#allowableValues}}allowableValues = {"{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"},{{/allowableValues}} description = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#defaultValue}}, example = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}})) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMapContainer}}""{{/isMapContainer}}{{^isMapContainer}}"{{baseName}}"{{/isMapContainer}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file From f3e613533ca9ae51890587d98a6b0b11b9f26903 Mon Sep 17 00:00:00 2001 From: Alexej Date: Sun, 8 Mar 2020 09:39:21 +0100 Subject: [PATCH 2/5] Fix OpenAPITools#4245 updated spring samples for client and server to use swagger-annotations 2.1.1 --- .../petstore/spring-cloud-async/pom.xml | 4 +- .../java/org/openapitools/api/PetApi.java | 146 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../java/org/openapitools/model/Category.java | 9 +- .../openapitools/model/ModelApiResponse.java | 11 +- .../java/org/openapitools/model/Order.java | 17 +- .../main/java/org/openapitools/model/Pet.java | 17 +- .../main/java/org/openapitools/model/Tag.java | 9 +- .../java/org/openapitools/model/User.java | 21 +- samples/client/petstore/spring-cloud/pom.xml | 4 +- .../java/org/openapitools/api/PetApi.java | 146 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../java/org/openapitools/model/Category.java | 9 +- .../openapitools/model/ModelApiResponse.java | 11 +- .../java/org/openapitools/model/Order.java | 17 +- .../main/java/org/openapitools/model/Pet.java | 17 +- .../main/java/org/openapitools/model/Tag.java | 9 +- .../java/org/openapitools/model/User.java | 21 +- samples/client/petstore/spring-stubs/pom.xml | 6 + .../java/org/openapitools/api/PetApi.java | 146 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../java/org/openapitools/model/Category.java | 9 +- .../openapitools/model/ModelApiResponse.java | 11 +- .../java/org/openapitools/model/Order.java | 17 +- .../main/java/org/openapitools/model/Pet.java | 17 +- .../main/java/org/openapitools/model/Tag.java | 9 +- .../java/org/openapitools/model/User.java | 21 +- .../petstore/spring-mvc-j8-async/pom.xml | 5 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../api/FakeClassnameTestApi.java | 22 ++- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../spring-mvc-j8-localdatetime/pom.xml | 5 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../api/FakeClassnameTestApi.java | 22 ++- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- samples/server/petstore/spring-mvc/pom.xml | 5 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../api/AnotherFakeApiController.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../openapitools/api/FakeApiController.java | 34 ++-- .../api/FakeClassnameTestApi.java | 22 ++- .../api/FakeClassnameTestApiController.java | 6 +- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../openapitools/api/PetApiController.java | 20 +- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../openapitools/api/StoreApiController.java | 10 +- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../openapitools/api/UserApiController.java | 18 +- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../springboot-beanvalidation/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../api/AnotherFakeApiController.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../openapitools/api/FakeApiController.java | 34 ++-- .../api/FakeClassnameTestApi.java | 22 ++- .../api/FakeClassnameTestApiController.java | 6 +- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../openapitools/api/PetApiController.java | 20 +- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../openapitools/api/StoreApiController.java | 10 +- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../openapitools/api/UserApiController.java | 18 +- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../petstore/springboot-delegate-j8/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../api/AnotherFakeApiDelegate.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../org/openapitools/api/FakeApiDelegate.java | 3 +- .../api/FakeClassnameTestApi.java | 22 ++- .../api/FakeClassnameTestApiDelegate.java | 3 +- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../openapitools/api/StoreApiDelegate.java | 3 +- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../org/openapitools/api/UserApiDelegate.java | 3 +- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../petstore/springboot-delegate/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../api/AnotherFakeApiController.java | 6 +- .../api/AnotherFakeApiDelegate.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../openapitools/api/FakeApiController.java | 34 ++-- .../org/openapitools/api/FakeApiDelegate.java | 3 +- .../api/FakeClassnameTestApi.java | 22 ++- .../api/FakeClassnameTestApiController.java | 6 +- .../api/FakeClassnameTestApiDelegate.java | 3 +- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../openapitools/api/PetApiController.java | 20 +- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../openapitools/api/StoreApiController.java | 10 +- .../openapitools/api/StoreApiDelegate.java | 3 +- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../openapitools/api/UserApiController.java | 18 +- .../org/openapitools/api/UserApiDelegate.java | 3 +- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../springboot-implicitHeaders/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 19 +- .../java/org/openapitools/api/FakeApi.java | 170 +++++++++------- .../api/FakeClassnameTestApi.java | 21 +- .../java/org/openapitools/api/PetApi.java | 144 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 57 +++--- .../java/org/openapitools/api/UserApi.java | 97 +++++---- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../petstore/springboot-reactive/pom.xml | 5 - .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../api/AnotherFakeApiDelegate.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../org/openapitools/api/FakeApiDelegate.java | 3 +- .../api/FakeClassnameTestApi.java | 22 ++- .../api/FakeClassnameTestApiDelegate.java | 3 +- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../openapitools/api/StoreApiDelegate.java | 3 +- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../org/openapitools/api/UserApiDelegate.java | 3 +- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../petstore/springboot-useoptional/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../api/FakeClassnameTestApi.java | 22 ++- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- .../petstore/springboot-virtualan/pom.xml | 6 + .../virtualan/api/AnotherFakeApi.java | 20 +- .../openapitools/virtualan/api/FakeApi.java | 185 ++++++++++-------- .../virtualan/api/FakeClassnameTestApi.java | 22 ++- .../openapitools/virtualan/api/PetApi.java | 152 ++++++-------- .../openapitools/virtualan/api/StoreApi.java | 61 +++--- .../openapitools/virtualan/api/UserApi.java | 105 +++++----- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../openapitools/virtualan/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../virtualan/model/ArrayOfNumberOnly.java | 5 +- .../virtualan/model/ArrayTest.java | 9 +- .../openapitools/virtualan/model/BigCat.java | 5 +- .../virtualan/model/BigCatAllOf.java | 5 +- .../virtualan/model/Capitalization.java | 15 +- .../org/openapitools/virtualan/model/Cat.java | 5 +- .../virtualan/model/CatAllOf.java | 5 +- .../virtualan/model/Category.java | 7 +- .../virtualan/model/ClassModel.java | 7 +- .../openapitools/virtualan/model/Client.java | 5 +- .../org/openapitools/virtualan/model/Dog.java | 5 +- .../virtualan/model/DogAllOf.java | 5 +- .../virtualan/model/EnumArrays.java | 7 +- .../virtualan/model/EnumClass.java | 1 + .../virtualan/model/EnumTest.java | 13 +- .../virtualan/model/FileSchemaTestClass.java | 7 +- .../virtualan/model/FormatTest.java | 31 ++- .../virtualan/model/HasOnlyReadOnly.java | 7 +- .../openapitools/virtualan/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../virtualan/model/Model200Response.java | 9 +- .../virtualan/model/ModelApiResponse.java | 9 +- .../virtualan/model/ModelReturn.java | 7 +- .../openapitools/virtualan/model/Name.java | 13 +- .../virtualan/model/NumberOnly.java | 5 +- .../openapitools/virtualan/model/Order.java | 15 +- .../virtualan/model/OuterComposite.java | 9 +- .../virtualan/model/OuterEnum.java | 1 + .../org/openapitools/virtualan/model/Pet.java | 15 +- .../virtualan/model/ReadOnlyFirst.java | 7 +- .../virtualan/model/SpecialModelName.java | 5 +- .../org/openapitools/virtualan/model/Tag.java | 7 +- .../virtualan/model/TypeHolderDefault.java | 13 +- .../virtualan/model/TypeHolderExample.java | 15 +- .../openapitools/virtualan/model/User.java | 19 +- .../openapitools/virtualan/model/XmlItem.java | 61 +++--- samples/server/petstore/springboot/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 20 +- .../java/org/openapitools/api/FakeApi.java | 185 ++++++++++-------- .../api/FakeClassnameTestApi.java | 22 ++- .../java/org/openapitools/api/PetApi.java | 152 ++++++-------- .../java/org/openapitools/api/StoreApi.java | 61 +++--- .../java/org/openapitools/api/UserApi.java | 105 +++++----- .../model/AdditionalPropertiesAnyType.java | 5 +- .../model/AdditionalPropertiesArray.java | 5 +- .../model/AdditionalPropertiesBoolean.java | 5 +- .../model/AdditionalPropertiesClass.java | 25 ++- .../model/AdditionalPropertiesInteger.java | 5 +- .../model/AdditionalPropertiesNumber.java | 5 +- .../model/AdditionalPropertiesObject.java | 5 +- .../model/AdditionalPropertiesString.java | 5 +- .../java/org/openapitools/model/Animal.java | 7 +- .../model/ArrayOfArrayOfNumberOnly.java | 5 +- .../openapitools/model/ArrayOfNumberOnly.java | 5 +- .../org/openapitools/model/ArrayTest.java | 9 +- .../java/org/openapitools/model/BigCat.java | 5 +- .../org/openapitools/model/BigCatAllOf.java | 5 +- .../openapitools/model/Capitalization.java | 15 +- .../main/java/org/openapitools/model/Cat.java | 5 +- .../java/org/openapitools/model/CatAllOf.java | 5 +- .../java/org/openapitools/model/Category.java | 7 +- .../org/openapitools/model/ClassModel.java | 7 +- .../java/org/openapitools/model/Client.java | 5 +- .../main/java/org/openapitools/model/Dog.java | 5 +- .../java/org/openapitools/model/DogAllOf.java | 5 +- .../org/openapitools/model/EnumArrays.java | 7 +- .../org/openapitools/model/EnumClass.java | 1 + .../java/org/openapitools/model/EnumTest.java | 13 +- .../model/FileSchemaTestClass.java | 7 +- .../org/openapitools/model/FormatTest.java | 31 ++- .../openapitools/model/HasOnlyReadOnly.java | 7 +- .../java/org/openapitools/model/MapTest.java | 11 +- ...ropertiesAndAdditionalPropertiesClass.java | 9 +- .../openapitools/model/Model200Response.java | 9 +- .../openapitools/model/ModelApiResponse.java | 9 +- .../org/openapitools/model/ModelReturn.java | 7 +- .../java/org/openapitools/model/Name.java | 13 +- .../org/openapitools/model/NumberOnly.java | 5 +- .../java/org/openapitools/model/Order.java | 15 +- .../openapitools/model/OuterComposite.java | 9 +- .../org/openapitools/model/OuterEnum.java | 1 + .../main/java/org/openapitools/model/Pet.java | 15 +- .../org/openapitools/model/ReadOnlyFirst.java | 7 +- .../openapitools/model/SpecialModelName.java | 5 +- .../main/java/org/openapitools/model/Tag.java | 7 +- .../openapitools/model/TypeHolderDefault.java | 13 +- .../openapitools/model/TypeHolderExample.java | 15 +- .../java/org/openapitools/model/User.java | 19 +- .../java/org/openapitools/model/XmlItem.java | 61 +++--- 649 files changed, 6165 insertions(+), 6299 deletions(-) diff --git a/samples/client/petstore/spring-cloud-async/pom.xml b/samples/client/petstore/spring-cloud-async/pom.xml index db09f2e25969..8ea24b2efb38 100644 --- a/samples/client/petstore/spring-cloud-async/pom.xml +++ b/samples/client/petstore/spring-cloud-async/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 2.1.1 org.springframework.boot @@ -34,7 +34,7 @@ - io.swagger + io.swagger.core.v3 swagger-annotations ${swagger-core-version} diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 61c2cf567b52..829a8ffa76aa 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -32,7 +37,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "Pet", description = "the Pet API") +@Tag(name = "Pet", description = "the Pet API") public interface PetApi { /** @@ -41,18 +46,14 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) - CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + CompletableFuture> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -62,17 +63,13 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + CompletableFuture> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); /** @@ -83,19 +80,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) - CompletableFuture>> 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); + CompletableFuture>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); /** @@ -107,19 +100,15 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) - CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + CompletableFuture>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); /** @@ -131,17 +120,16 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) - CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + CompletableFuture> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); /** @@ -152,20 +140,16 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) , + @ApiResponse(responseCode = "405", description = "Validation exception" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) - CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + CompletableFuture> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -176,18 +160,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + CompletableFuture> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@Parameter( description = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); /** @@ -198,18 +178,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + CompletableFuture> uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @RequestParam("file") MultipartFile file); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 3e5468a77599..bd181b738ff9 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "Store", description = "the Store API") +@Tag(name = "Store", description = "the Store API") public interface StoreApi { /** @@ -42,13 +47,14 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) - CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); + CompletableFuture> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId); /** @@ -57,12 +63,11 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) CompletableFuture>> getInventory(); @@ -77,15 +82,16 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) - CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); + CompletableFuture> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId); /** @@ -95,13 +101,14 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) - CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + CompletableFuture> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index ac96feda228e..4401506d0c35 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "User", description = "the User API") +@Tag(name = "User", description = "the User API") public interface UserApi { /** @@ -41,12 +46,13 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + CompletableFuture> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); /** @@ -55,12 +61,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + CompletableFuture> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -69,12 +76,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + CompletableFuture> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -85,13 +93,14 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + CompletableFuture> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); /** @@ -102,15 +111,16 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) - CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + CompletableFuture> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); /** @@ -121,14 +131,15 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) - CompletableFuture> 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); + CompletableFuture> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); /** @@ -136,10 +147,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) CompletableFuture> logoutUser(); @@ -153,12 +165,13 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - CompletableFuture> 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); + CompletableFuture> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java index b1ad95d3952b..c151b07a640e 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A category for a pet */ -@ApiModel(description = "A category for a pet") +@Schema(description = "A category for a pet") public class Category { @JsonProperty("id") @@ -30,7 +29,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java index cc9dc2341c6d..becc0edff96d 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Describes the result of uploading an image resource */ -@ApiModel(description = "Describes the result of uploading an image resource") +@Schema(description = "Describes the result of uploading an image resource") public class ModelApiResponse { @JsonProperty("code") @@ -33,7 +32,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -53,7 +52,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -73,7 +72,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java index 74afafe55585..88ff7b33c650 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -14,7 +13,7 @@ /** * An order for a pets from the pet store */ -@ApiModel(description = "An order for a pets from the pet store") +@Schema(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") @@ -81,7 +80,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -101,7 +100,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -121,7 +120,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -141,7 +140,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -162,7 +161,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -182,7 +181,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index d14c54e6abac..27612ee9d468 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -17,7 +16,7 @@ /** * A pet for sale in the pet store */ -@ApiModel(description = "A pet for sale in the pet store") +@Schema(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") @@ -86,7 +85,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -106,7 +105,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -127,7 +126,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -153,7 +152,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -182,7 +181,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -203,7 +202,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java index 8eb2e846891a..c81f2b75ce39 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A tag for a pet */ -@ApiModel(description = "A tag for a pet") +@Schema(description = "A tag for a pet") public class Tag { @JsonProperty("id") @@ -30,7 +29,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java index 95d92cd2ecbf..7c9698aedb82 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A User who is purchasing from the pet store */ -@ApiModel(description = "A User who is purchasing from the pet store") +@Schema(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") @@ -48,7 +47,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -68,7 +67,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -88,7 +87,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -108,7 +107,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -128,7 +127,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -148,7 +147,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -168,7 +167,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -188,7 +187,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index db09f2e25969..8ea24b2efb38 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -9,7 +9,7 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 2.1.1 org.springframework.boot @@ -34,7 +34,7 @@ - io.swagger + io.swagger.core.v3 swagger-annotations ${swagger-core-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 4e559cd715ce..c2b0de7f3685 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,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "Pet", description = "the Pet API") +@Tag(name = "Pet", description = "the Pet API") public interface PetApi { /** @@ -40,18 +45,14 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + com.netflix.hystrix.HystrixCommand> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -61,17 +62,13 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + com.netflix.hystrix.HystrixCommand> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); /** @@ -82,19 +79,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand>> 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); + com.netflix.hystrix.HystrixCommand>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); /** @@ -106,19 +99,15 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + com.netflix.hystrix.HystrixCommand>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); /** @@ -130,17 +119,16 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + com.netflix.hystrix.HystrixCommand> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); /** @@ -151,20 +139,16 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) , + @ApiResponse(responseCode = "405", description = "Validation exception" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + com.netflix.hystrix.HystrixCommand> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -175,18 +159,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); + com.netflix.hystrix.HystrixCommand> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@Parameter( description = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); /** @@ -197,18 +177,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file); + com.netflix.hystrix.HystrixCommand> uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @RequestParam("file") 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 a0105466463a..4980c04e87e8 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "Store", description = "the Store API") +@Tag(name = "Store", description = "the Store API") public interface StoreApi { /** @@ -41,13 +46,14 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId); + com.netflix.hystrix.HystrixCommand> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId); /** @@ -56,12 +62,11 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand>> getInventory(); @@ -76,15 +81,16 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId); + com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId); /** @@ -94,13 +100,14 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + com.netflix.hystrix.HystrixCommand> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); } 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 660007746828..631165d5b0a9 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "User", description = "the User API") +@Tag(name = "User", description = "the User API") public interface UserApi { /** @@ -40,12 +45,13 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + com.netflix.hystrix.HystrixCommand> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); /** @@ -54,12 +60,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -68,12 +75,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -84,13 +92,14 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - com.netflix.hystrix.HystrixCommand> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + com.netflix.hystrix.HystrixCommand> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); /** @@ -101,15 +110,16 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + com.netflix.hystrix.HystrixCommand> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); /** @@ -120,14 +130,15 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) - com.netflix.hystrix.HystrixCommand> 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); + com.netflix.hystrix.HystrixCommand> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); /** @@ -135,10 +146,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> logoutUser(); @@ -152,12 +164,13 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - com.netflix.hystrix.HystrixCommand> 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); + com.netflix.hystrix.HystrixCommand> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); } 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 b1ad95d3952b..c151b07a640e 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A category for a pet */ -@ApiModel(description = "A category for a pet") +@Schema(description = "A category for a pet") public class Category { @JsonProperty("id") @@ -30,7 +29,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 cc9dc2341c6d..becc0edff96d 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Describes the result of uploading an image resource */ -@ApiModel(description = "Describes the result of uploading an image resource") +@Schema(description = "Describes the result of uploading an image resource") public class ModelApiResponse { @JsonProperty("code") @@ -33,7 +32,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -53,7 +52,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -73,7 +72,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 74afafe55585..88ff7b33c650 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 @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -14,7 +13,7 @@ /** * An order for a pets from the pet store */ -@ApiModel(description = "An order for a pets from the pet store") +@Schema(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") @@ -81,7 +80,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -101,7 +100,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -121,7 +120,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -141,7 +140,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -162,7 +161,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -182,7 +181,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 d14c54e6abac..27612ee9d468 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -17,7 +16,7 @@ /** * A pet for sale in the pet store */ -@ApiModel(description = "A pet for sale in the pet store") +@Schema(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") @@ -86,7 +85,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -106,7 +105,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -127,7 +126,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -153,7 +152,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -182,7 +181,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -203,7 +202,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 8eb2e846891a..c81f2b75ce39 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A tag for a pet */ -@ApiModel(description = "A tag for a pet") +@Schema(description = "A tag for a pet") public class Tag { @JsonProperty("id") @@ -30,7 +29,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 95d92cd2ecbf..7c9698aedb82 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A User who is purchasing from the pet store */ -@ApiModel(description = "A User who is purchasing from the pet store") +@Schema(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") @@ -48,7 +47,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -68,7 +67,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -88,7 +87,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -108,7 +107,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -128,7 +127,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -148,7 +147,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -168,7 +167,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -188,7 +187,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/client/petstore/spring-stubs/pom.xml b/samples/client/petstore/spring-stubs/pom.xml index 18b3dc2308db..3134f54da5bf 100644 --- a/samples/client/petstore/spring-stubs/pom.xml +++ b/samples/client/petstore/spring-stubs/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -35,6 +36,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 8f7e6b302e0f..5a1e42450f0a 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -44,18 +49,14 @@ default Optional getRequest() { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -68,17 +69,13 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -92,19 +89,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -133,19 +126,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -174,17 +163,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -212,20 +200,16 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) , + @ApiResponse(responseCode = "405", description = "Validation exception" ) }) + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -239,18 +223,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -264,19 +244,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 12948c8a358a..13725f63d455 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -45,13 +50,14 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("orderId") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,12 +69,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -86,15 +91,16 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{orderId}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("orderId") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,14 +127,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 280d0cd069b5..08a7ac0c5da9 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -44,12 +49,13 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,12 +67,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,12 +85,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,13 +105,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -117,15 +126,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -153,14 +163,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -171,10 +182,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -191,13 +203,14 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java index b1ad95d3952b..c151b07a640e 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A category for a pet */ -@ApiModel(description = "A category for a pet") +@Schema(description = "A category for a pet") public class Category { @JsonProperty("id") @@ -30,7 +29,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java index cc9dc2341c6d..becc0edff96d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Describes the result of uploading an image resource */ -@ApiModel(description = "Describes the result of uploading an image resource") +@Schema(description = "Describes the result of uploading an image resource") public class ModelApiResponse { @JsonProperty("code") @@ -33,7 +32,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -53,7 +52,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -73,7 +72,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java index 74afafe55585..88ff7b33c650 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -14,7 +13,7 @@ /** * An order for a pets from the pet store */ -@ApiModel(description = "An order for a pets from the pet store") +@Schema(description = "An order for a pets from the pet store") public class Order { @JsonProperty("id") @@ -81,7 +80,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -101,7 +100,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -121,7 +120,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -141,7 +140,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -162,7 +161,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -182,7 +181,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index d14c54e6abac..27612ee9d468 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -17,7 +16,7 @@ /** * A pet for sale in the pet store */ -@ApiModel(description = "A pet for sale in the pet store") +@Schema(description = "A pet for sale in the pet store") public class Pet { @JsonProperty("id") @@ -86,7 +85,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -106,7 +105,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -127,7 +126,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -153,7 +152,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -182,7 +181,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -203,7 +202,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java index 8eb2e846891a..c81f2b75ce39 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A tag for a pet */ -@ApiModel(description = "A tag for a pet") +@Schema(description = "A tag for a pet") public class Tag { @JsonProperty("id") @@ -30,7 +29,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -50,7 +49,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java index 95d92cd2ecbf..7c9698aedb82 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * A User who is purchasing from the pet store */ -@ApiModel(description = "A User who is purchasing from the pet store") +@Schema(description = "A User who is purchasing from the pet store") public class User { @JsonProperty("id") @@ -48,7 +47,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -68,7 +67,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -88,7 +87,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -108,7 +107,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -128,7 +127,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -148,7 +147,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -168,7 +167,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -188,7 +187,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index 7b53a777e423..686efbc0ff2d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -122,6 +122,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + 2.1.1 + com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 2280af258b73..08387dae1953 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.concurrent.CompletableFuture; @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() { @@ -44,14 +49,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default CompletableFuture> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default CompletableFuture> call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 60269f46493b..0a06b5f5dbd3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +45,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default Optional getRequest() { @@ -54,13 +59,14 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default CompletableFuture> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default CompletableFuture> createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -73,13 +79,14 @@ default CompletableFuture> createXmlItem(@ApiParam(value = * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default CompletableFuture> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default CompletableFuture> fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -92,13 +99,14 @@ default CompletableFuture> fakeOuterBooleanSerialize(@Ap * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default CompletableFuture> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default CompletableFuture> fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -122,13 +130,14 @@ default CompletableFuture> fakeOuterCompositeSeri * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default CompletableFuture> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default CompletableFuture> fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -141,13 +150,14 @@ default CompletableFuture> fakeOuterNumberSerialize(@ * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default CompletableFuture> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default CompletableFuture> fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -160,13 +170,14 @@ default CompletableFuture> fakeOuterStringSerialize(@ApiP * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default CompletableFuture> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default CompletableFuture> testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -179,13 +190,14 @@ default CompletableFuture> testBodyWithFileSchema(@ApiParam * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default CompletableFuture> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default CompletableFuture> testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -198,14 +210,15 @@ default CompletableFuture> testBodyWithQueryParams(@NotNull * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default CompletableFuture> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default CompletableFuture> testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -243,16 +256,15 @@ default CompletableFuture> testClientModel(@ApiParam(valu * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default CompletableFuture> testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default CompletableFuture> testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -273,14 +285,15 @@ default CompletableFuture> testEndpointParameters(@ApiParam * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default CompletableFuture> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default CompletableFuture> testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -298,12 +311,13 @@ default CompletableFuture> testEnumParameters(@ApiParam(val * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default CompletableFuture> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default CompletableFuture> testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -315,13 +329,14 @@ default CompletableFuture> testGroupParameters(@NotNull @Ap * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default CompletableFuture> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default CompletableFuture> testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -334,13 +349,14 @@ default CompletableFuture> testInlineAdditionalProperties(@ * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default CompletableFuture> testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default CompletableFuture> testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -357,12 +373,13 @@ default CompletableFuture> testJsonFormData(@ApiParam(value * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - default CompletableFuture> 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) { + default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -376,19 +393,15 @@ default CompletableFuture> testQueryParameterCollectionForm * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default CompletableFuture> uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index a321dc6fe056..9baee9561b0f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default Optional getRequest() { @@ -44,16 +49,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default CompletableFuture> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default CompletableFuture> testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index e13f09246b07..0996f0e10f9c 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -32,7 +37,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -46,19 +51,15 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default CompletableFuture> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default CompletableFuture> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -72,18 +73,14 @@ default CompletableFuture> addPet(@ApiParam(value = "Pet ob * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default CompletableFuture> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default CompletableFuture> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -97,19 +94,15 @@ default CompletableFuture> deletePet(@ApiParam(value = "Pet * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture>> 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) { + default CompletableFuture>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -140,19 +133,15 @@ default CompletableFuture>> findPetsByStatus(@NotNull @ * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default CompletableFuture>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -183,17 +172,16 @@ default CompletableFuture>> findPetsByTags(@NotNull @Ap * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default CompletableFuture> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -224,21 +212,17 @@ default CompletableFuture> getPetById(@ApiParam(value = "ID * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default CompletableFuture> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default CompletableFuture> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -252,18 +236,14 @@ default CompletableFuture> updatePet(@ApiParam(value = "Pet * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default CompletableFuture> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default CompletableFuture> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -277,19 +257,15 @@ default CompletableFuture> updatePetWithForm(@ApiParam(valu * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default CompletableFuture> uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 7bab07836ffd..960ce4e5b717 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -46,13 +51,14 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default CompletableFuture> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default CompletableFuture> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -64,12 +70,11 @@ default CompletableFuture> deleteOrder(@ApiParam(value = "I * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default CompletableFuture>> getInventory() { @@ -87,15 +92,16 @@ default CompletableFuture>> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -124,14 +130,15 @@ default CompletableFuture> getOrderById(@Min(1L) @Max(5L) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default CompletableFuture> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default CompletableFuture> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 496d6411aad9..a16a3a757c60 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.concurrent.CompletableFuture; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -45,12 +50,13 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default CompletableFuture> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default CompletableFuture> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -62,12 +68,13 @@ default CompletableFuture> createUser(@ApiParam(value = "Cr * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default CompletableFuture> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default CompletableFuture> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -79,12 +86,13 @@ default CompletableFuture> createUsersWithArrayInput(@ApiPa * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default CompletableFuture> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default CompletableFuture> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -98,13 +106,14 @@ default CompletableFuture> createUsersWithListInput(@ApiPar * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default CompletableFuture> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default CompletableFuture> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -118,15 +127,16 @@ default CompletableFuture> deleteUser(@ApiParam(value = "Th * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default CompletableFuture> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -156,14 +166,15 @@ default CompletableFuture> getUserByName(@ApiParam(value = * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> 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) { + default CompletableFuture> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } @@ -174,10 +185,11 @@ default CompletableFuture> loginUser(@NotNull @ApiParam(v * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default CompletableFuture> logoutUser() { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -194,13 +206,14 @@ default CompletableFuture> logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - default CompletableFuture> 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) { + default CompletableFuture> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 448c77cea931..2bb2a9d8b557 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a80499fd79b9..6c18ec800a17 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d8db9baf3105..7c1817d8c26f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b7f58b90fa6b..86013b3c333a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index b2da4b9b26a6..868aed4a9571 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java index fb134a8c4419..8824dc475202 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java index 9bc946d6cc1a..018c492a2343 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java index e1346fe63ea8..7bf8478e1cb2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java index f6d3c17d0be3..d9dd35d2cc0f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java index db3f8e08dc0d..d38268331306 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java index ba96dc2add68..e629558ddd33 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java index 59d479c85336..a6f5ae46f310 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java index 02e027c3feea..cafc2475a0af 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java index 7ee6a9816197..495ca0bf4dc1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f0..20fc4c146cc6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java index 8eff3e0c49aa..0a947d475d6b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 2e88258ce75c..b882906b48b4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index c2ca28b35414..cb69731bd762 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c0e7dd75528e..e0ccd50d7253 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java index 80195fc3d4be..e8f0ff889bdd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6f7a0b5d56e3..b03730404c34 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java index 04606fb90460..d429586a876f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java index 1d385b21bd4d..bd50387c2d06 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java index 82026635f5cb..b31b09ec67e5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java index 1180f019ea3f..8c16d7e0aea6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java index 4423a2ac631d..3bec692c1b36 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java index e91680a724ef..585c5a0d90e2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java index 61dbaaefeeae..73a490ce3fb6 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b07..3eb6a8fc3319 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..4dbec5747b4a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 4e1c3e681095..9a561070c4e2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java index 6c0bfa749d3d..04ff14e1e652 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/SpecialModelName.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java index c72064ce0428..fb71f3181345 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7dd51d7ccd56..ce1338ae159e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java index c1f4cbd00a72..57b09a4d0a35 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java index d195089778a9..d01e4cfe4e97 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java index dae97d794675..c391ec3c7556 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/XmlItem.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index dc6449795536..8291d8380272 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -122,6 +122,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + 2.1.1 + com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 27c8e569d3f7..65f4740bc51c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @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() { @@ -43,14 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 17bfc21bf1ee..6194391da3b8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -39,7 +44,7 @@ import java.util.Optional; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default Optional getRequest() { @@ -53,13 +58,14 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,13 +78,14 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,13 +98,14 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -119,13 +127,14 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,13 +147,14 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -157,13 +167,14 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,13 +187,14 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -195,14 +207,15 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -238,16 +251,15 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) LocalDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) LocalDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -268,14 +280,15 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -293,12 +306,13 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -310,13 +324,14 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -329,13 +344,14 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -352,12 +368,13 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,19 +388,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1aa913b3f22e..d5e698d2b779 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default Optional getRequest() { @@ -43,16 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index b68809eabc37..6d281fbede4e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -45,19 +50,15 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -71,18 +72,14 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,19 +93,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -137,19 +130,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -178,17 +167,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,21 +205,17 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,18 +229,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -270,19 +250,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 065462225ab8..7049253cccb1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -45,13 +50,14 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,12 +69,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -86,15 +91,16 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,14 +127,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 9123fb350a95..0b8acf16d830 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -44,12 +49,13 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,12 +67,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,12 +85,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,13 +105,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -117,15 +126,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -153,14 +163,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -171,10 +182,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -191,13 +203,14 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 448c77cea931..2bb2a9d8b557 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a80499fd79b9..6c18ec800a17 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d8db9baf3105..7c1817d8c26f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b7f58b90fa6b..86013b3c333a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index b2da4b9b26a6..868aed4a9571 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java index fb134a8c4419..8824dc475202 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ArrayTest.java @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java index 9bc946d6cc1a..018c492a2343 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCat.java @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java index e1346fe63ea8..7bf8478e1cb2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Capitalization.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java index f6d3c17d0be3..d9dd35d2cc0f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Cat.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java index db3f8e08dc0d..d38268331306 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java index ba96dc2add68..e629558ddd33 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ClassModel.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java index 59d479c85336..a6f5ae46f310 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Client.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java index 02e027c3feea..cafc2475a0af 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Dog.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java index 7ee6a9816197..495ca0bf4dc1 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumArrays.java @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f0..20fc4c146cc6 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumClass.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java index 8eff3e0c49aa..0a947d475d6b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/EnumTest.java @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 2e88258ce75c..b882906b48b4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index d0b99e8bc17f..7d4166a27b67 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -3,13 +3,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 java.time.LocalDate; import java.time.LocalDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(LocalDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c0e7dd75528e..e0ccd50d7253 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java index 80195fc3d4be..e8f0ff889bdd 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MapTest.java @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 02ef3036e6b6..b9b1b125b4ea 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,14 +3,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.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(LocalDateTime dateTi * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java index 04606fb90460..d429586a876f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Model200Response.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java index 1d385b21bd4d..bd50387c2d06 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java index 82026635f5cb..b31b09ec67e5 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ModelReturn.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java index 1180f019ea3f..8c16d7e0aea6 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Name.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java index 4423a2ac631d..3bec692c1b36 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/NumberOnly.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java index dcc367e50e4c..5b8b92689a27 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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.LocalDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(LocalDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java index 61dbaaefeeae..73a490ce3fb6 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterComposite.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b07..3eb6a8fc3319 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/OuterEnum.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..4dbec5747b4a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 4e1c3e681095..9a561070c4e2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java index 6c0bfa749d3d..04ff14e1e652 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/SpecialModelName.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java index c72064ce0428..fb71f3181345 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7dd51d7ccd56..ce1338ae159e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java index c1f4cbd00a72..57b09a4d0a35 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java index d195089778a9..d01e4cfe4e97 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java index dae97d794675..c391ec3c7556 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/XmlItem.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index 49b9cce014cd..bd0ddcb190cd 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -122,6 +122,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + 2.1.1 + com.github.joschi.jackson jackson-datatype-threetenbp diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 219c200849f5..d8ddb6945ce3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "another-fake", description = "the another-fake API") +@Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { /** @@ -35,13 +40,14 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 4e726b8380bd..17ecb3154796 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public AnotherFakeApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 16c00a65a4a8..5059a5685a8a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -35,7 +40,7 @@ import java.util.Map; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { /** @@ -45,13 +50,14 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -61,13 +67,14 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -77,13 +84,14 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -93,13 +101,14 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,13 +118,14 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -125,13 +135,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -141,13 +152,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); /** @@ -157,14 +169,15 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); /** @@ -188,16 +201,15 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); /** @@ -215,14 +227,15 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); + ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); /** @@ -237,12 +250,13 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); /** @@ -251,13 +265,14 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); /** @@ -267,13 +282,14 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2); + ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); /** @@ -287,12 +303,13 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); /** @@ -303,18 +320,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java index 20bd9fdd868c..e24ec2f382e0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,7 +11,9 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -50,7 +52,7 @@ public FakeApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,7 +65,7 @@ public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,requ * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -76,7 +78,7 @@ public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inpu * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; @@ -96,7 +98,7 @@ public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(valu * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -109,7 +111,7 @@ public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "In * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -122,7 +124,7 @@ public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -135,7 +137,7 @@ public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,require * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -148,7 +150,7 @@ public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = " * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; @@ -182,7 +184,7 @@ public ResponseEntity testClientModel(@ApiParam(value = "client model" , * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + public ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -203,7 +205,7 @@ public ResponseEntity testEndpointParameters(@ApiParam(value = "None", req * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + public ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -221,7 +223,7 @@ public ResponseEntity testEnumParameters(@ApiParam(value = "Header paramet * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -233,7 +235,7 @@ public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Requ * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,7 +248,7 @@ public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "re * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + public ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -263,7 +265,7 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public 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) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -277,7 +279,7 @@ public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPara * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7d57d6280777..b9a2cf114d8c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { /** @@ -35,15 +40,14 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index ef55a490d396..6e9c5a5a5056 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public FakeClassnameTestApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index c8c43b67e00d..7a704bd2fb06 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -27,7 +32,7 @@ import java.util.Map; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { /** @@ -37,19 +42,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -60,18 +61,14 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); /** @@ -82,19 +79,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); /** @@ -106,19 +99,15 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); /** @@ -130,17 +119,16 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); /** @@ -152,21 +140,17 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -177,18 +161,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); /** @@ -199,18 +179,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); + ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java index 0826a0bb56a6..d0d15a44f5b3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java @@ -3,7 +3,9 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -42,7 +44,7 @@ public PetApiController(NativeWebRequest request) { * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,7 +58,7 @@ public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to b * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + public ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,7 +72,7 @@ public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requi * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public 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) { + public ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -97,7 +99,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -124,7 +126,7 @@ public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -151,7 +153,7 @@ public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",re * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -165,7 +167,7 @@ public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs t * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + public ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -179,7 +181,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + public ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 59e47ec85fe4..77298dbfe3a3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { /** @@ -37,13 +42,14 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); /** @@ -52,12 +58,11 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -72,15 +77,16 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); /** @@ -90,13 +96,14 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java index e926baf28298..be8e88083932 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,9 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -42,7 +44,7 @@ public StoreApiController(NativeWebRequest request) { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -69,7 +71,7 @@ public ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; @@ -94,7 +96,7 @@ public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "I * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 6252c2affe3f..6467a130507d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { /** @@ -36,12 +41,13 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); /** @@ -50,12 +56,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -64,12 +71,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -80,13 +88,14 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); /** @@ -97,15 +106,16 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); /** @@ -116,14 +126,15 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); /** @@ -131,10 +142,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +160,13 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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); + ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java index ee0f252668d0..02136accde12 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApiController.java @@ -2,7 +2,9 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -41,7 +43,7 @@ public UserApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -53,7 +55,7 @@ public ResponseEntity createUser(@ApiParam(value = "Created user object" , * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,7 +67,7 @@ public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -79,7 +81,7 @@ public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -93,7 +95,7 @@ public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; @@ -119,7 +121,7 @@ public ResponseEntity getUserByName(@ApiParam(value = "The name that needs * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public 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) { + public ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +147,7 @@ public ResponseEntity logoutUser() { * or User not found (status code 404) * @see UserApi#updateUser */ - public 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) { + public ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 448c77cea931..2bb2a9d8b557 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a80499fd79b9..6c18ec800a17 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d8db9baf3105..7c1817d8c26f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b9d1c52f961a..82eec5480e3f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index a76320466a38..b0d2df447641 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java index df4610324400..75e222a26592 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ArrayTest.java @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java index 9bc946d6cc1a..018c492a2343 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCat.java @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java index e1346fe63ea8..7bf8478e1cb2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Capitalization.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java index f6d3c17d0be3..d9dd35d2cc0f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Cat.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java index db3f8e08dc0d..d38268331306 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java index ba96dc2add68..e629558ddd33 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ClassModel.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java index 59d479c85336..a6f5ae46f310 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Client.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java index 02e027c3feea..cafc2475a0af 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Dog.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java index d57bb6c1de46..d9cf10c60d7a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumArrays.java @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f0..20fc4c146cc6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumClass.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java index 8eff3e0c49aa..0a947d475d6b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/EnumTest.java @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java index ab7b747bf2fa..9afea2d563fe 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index e0887e113301..e275f4968651 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -3,13 +3,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 java.util.UUID; import org.springframework.core.io.Resource; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c0e7dd75528e..e0ccd50d7253 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java index c9b418c6901b..6b5ba4771d1b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MapTest.java @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6c0fe72d4773..47d95a8be224 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,14 +3,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.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java index 04606fb90460..d429586a876f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Model200Response.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java index 1d385b21bd4d..bd50387c2d06 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java index 82026635f5cb..b31b09ec67e5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ModelReturn.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java index 1180f019ea3f..8c16d7e0aea6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Name.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java index 4423a2ac631d..3bec692c1b36 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/NumberOnly.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java index 26b38944e11a..14384258d87b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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 org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java index 61dbaaefeeae..73a490ce3fb6 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterComposite.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b07..3eb6a8fc3319 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/OuterEnum.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java index e91bc5697c75..8d83137623ec 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 4e1c3e681095..9a561070c4e2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java index 6c0bfa749d3d..04ff14e1e652 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/SpecialModelName.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java index c72064ce0428..fb71f3181345 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java index b88e00b47d78..e0ef7edf918a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java index 85694fed2185..02096983e0d3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java index d195089778a9..d01e4cfe4e97 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java index ca74cfcfd91c..f3d9550f40ba 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/XmlItem.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-beanvalidation/pom.xml b/samples/server/petstore/springboot-beanvalidation/pom.xml index 6536e609c6cf..e9893dc66825 100644 --- a/samples/server/petstore/springboot-beanvalidation/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 219c200849f5..d8ddb6945ce3 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "another-fake", description = "the another-fake API") +@Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { /** @@ -35,13 +40,14 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java index 7c59d2bef71a..d21d53930782 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public AnotherFakeApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; 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 16c00a65a4a8..5059a5685a8a 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -35,7 +40,7 @@ import java.util.Map; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { /** @@ -45,13 +50,14 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -61,13 +67,14 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -77,13 +84,14 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -93,13 +101,14 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,13 +118,14 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -125,13 +135,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -141,13 +152,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); /** @@ -157,14 +169,15 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); /** @@ -188,16 +201,15 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); /** @@ -215,14 +227,15 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); + ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); /** @@ -237,12 +250,13 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); /** @@ -251,13 +265,14 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); /** @@ -267,13 +282,14 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2); + ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); /** @@ -287,12 +303,13 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); /** @@ -303,18 +320,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java index 926883747be6..786f4642b36e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,7 +11,9 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -50,7 +52,7 @@ public FakeApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,7 +65,7 @@ public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,requ * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -76,7 +78,7 @@ public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inpu * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; @@ -96,7 +98,7 @@ public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(valu * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -109,7 +111,7 @@ public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "In * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -122,7 +124,7 @@ public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -135,7 +137,7 @@ public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,require * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -148,7 +150,7 @@ public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = " * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; @@ -182,7 +184,7 @@ public ResponseEntity testClientModel(@ApiParam(value = "client model" , * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + public ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -203,7 +205,7 @@ public ResponseEntity testEndpointParameters(@ApiParam(value = "None", req * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + public ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -221,7 +223,7 @@ public ResponseEntity testEnumParameters(@ApiParam(value = "Header paramet * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -233,7 +235,7 @@ public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Requ * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -246,7 +248,7 @@ public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "re * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + public ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -263,7 +265,7 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public 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) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -277,7 +279,7 @@ public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPara * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; 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 7d57d6280777..b9a2cf114d8c 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { /** @@ -35,15 +40,14 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 2d420c2f7862..c5d31a05b4c3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public FakeClassnameTestApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"client\" : \"client\" }"; 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 c8c43b67e00d..7a704bd2fb06 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -27,7 +32,7 @@ import java.util.Map; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { /** @@ -37,19 +42,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -60,18 +61,14 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); /** @@ -82,19 +79,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); /** @@ -106,19 +99,15 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); /** @@ -130,17 +119,16 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); /** @@ -152,21 +140,17 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -177,18 +161,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); /** @@ -199,18 +179,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); + ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index c069666d08b3..1f85b81c6a40 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -3,7 +3,9 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -42,7 +44,7 @@ public PetApiController(NativeWebRequest request) { * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -56,7 +58,7 @@ public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to b * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + public ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,7 +72,7 @@ public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requi * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public 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) { + public ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -97,7 +99,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -124,7 +126,7 @@ public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; @@ -151,7 +153,7 @@ public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",re * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -165,7 +167,7 @@ public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs t * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + public ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -179,7 +181,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + public ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; 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 59e47ec85fe4..77298dbfe3a3 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { /** @@ -37,13 +42,14 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); /** @@ -52,12 +58,11 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -72,15 +77,16 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); /** @@ -90,13 +96,14 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java index bba9d136df69..878497718053 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,9 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -42,7 +44,7 @@ public StoreApiController(NativeWebRequest request) { * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -69,7 +71,7 @@ public ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; @@ -94,7 +96,7 @@ public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "I * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; 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 6252c2affe3f..6467a130507d 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { /** @@ -36,12 +41,13 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); /** @@ -50,12 +56,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -64,12 +71,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -80,13 +88,14 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); /** @@ -97,15 +106,16 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); /** @@ -116,14 +126,15 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); /** @@ -131,10 +142,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +160,13 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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); + ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java index fd1e6d5ab5db..d0d9a39ac17f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApiController.java @@ -2,7 +2,9 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -41,7 +43,7 @@ public UserApiController(NativeWebRequest request) { * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -53,7 +55,7 @@ public ResponseEntity createUser(@ApiParam(value = "Created user object" , * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,7 +67,7 @@ public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -79,7 +81,7 @@ public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -93,7 +95,7 @@ public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; @@ -119,7 +121,7 @@ public ResponseEntity getUserByName(@ApiParam(value = "The name that needs * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public 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) { + public ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +147,7 @@ public ResponseEntity logoutUser() { * or User not found (status code 404) * @see UserApi#updateUser */ - public 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) { + public ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b9d1c52f961a..82eec5480e3f 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 a76320466a38..b0d2df447641 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 df4610324400..75e222a26592 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 d57bb6c1de46..d9cf10c60d7a 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 ab7b747bf2fa..9afea2d563fe 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e0887e113301..e275f4968651 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 @@ -3,13 +3,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 java.util.UUID; import org.springframework.core.io.Resource; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 c9b418c6901b..6b5ba4771d1b 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6c0fe72d4773..47d95a8be224 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 @@ -3,14 +3,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.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 26b38944e11a..14384258d87b 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 @@ -4,9 +4,8 @@ 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 org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 e91bc5697c75..8d83137623ec 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b88e00b47d78..e0ef7edf918a 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 85694fed2185..02096983e0d3 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 ca74cfcfd91c..f3d9550f40ba 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index b3b8c885f0da..e46c6830563f 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 dd59ddd21d17..7bea4f5644f8 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @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() { @@ -39,14 +44,15 @@ default AnotherFakeApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return getDelegate().call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 1ccbe873d5ad..a5ecd30de174 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -1,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 c08e643c764e..cceeeb60d6d7 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -35,7 +40,7 @@ import java.util.Map; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default FakeApiDelegate getDelegate() { @@ -49,13 +54,14 @@ default FakeApiDelegate getDelegate() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return getDelegate().createXmlItem(xmlItem); } @@ -67,13 +73,14 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return getDelegate().fakeOuterBooleanSerialize(body); } @@ -85,13 +92,14 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return getDelegate().fakeOuterCompositeSerialize(body); } @@ -103,13 +111,14 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return getDelegate().fakeOuterNumberSerialize(body); } @@ -121,13 +130,14 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return getDelegate().fakeOuterStringSerialize(body); } @@ -139,13 +149,14 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return getDelegate().testBodyWithFileSchema(body); } @@ -157,13 +168,14 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return getDelegate().testBodyWithQueryParams(query, body); } @@ -175,14 +187,15 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return getDelegate().testClientModel(body); } @@ -208,16 +221,15 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -237,14 +249,15 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -261,12 +274,13 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -277,13 +291,14 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return getDelegate().testInlineAdditionalProperties(param); } @@ -295,13 +310,14 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return getDelegate().testJsonFormData(param, param2); } @@ -317,12 +333,13 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -335,19 +352,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(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/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index d1dd5548a627..bde4a319bdaa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -11,7 +11,8 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 74a65a8bec56..824cc2c37074 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { @@ -39,16 +44,15 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return getDelegate().testClassname(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 7436e049bdeb..525a2c3f9937 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -1,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 2334a48ef423..c09bfedff2fc 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -27,7 +32,7 @@ import java.util.Map; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default PetApiDelegate getDelegate() { @@ -41,19 +46,15 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return getDelegate().addPet(body); } @@ -66,18 +67,14 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return getDelegate().deletePet(petId, apiKey); } @@ -90,19 +87,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { return getDelegate().findPetsByStatus(status); } @@ -116,19 +109,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { return getDelegate().findPetsByTags(tags); } @@ -142,17 +131,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { return getDelegate().getPetById(petId); } @@ -166,21 +154,17 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return getDelegate().updatePet(body); } @@ -193,18 +177,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return getDelegate().updatePetWithForm(petId, name, status); } @@ -217,19 +197,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { return getDelegate().uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 44d7d779d04c..9b3ce8aa873c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -3,7 +3,8 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 0e5ff592a7dc..0fb7d8ff0521 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default StoreApiDelegate getDelegate() { @@ -41,13 +46,14 @@ default StoreApiDelegate getDelegate() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return getDelegate().deleteOrder(orderId); } @@ -58,12 +64,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -80,15 +85,16 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { return getDelegate().getOrderById(orderId); } @@ -100,14 +106,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { return getDelegate().placeOrder(body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index 5fe814ddf2b8..1e30491b5a70 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -2,7 +2,8 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 36a0c443648e..d5df488b8e24 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default UserApiDelegate getDelegate() { @@ -40,12 +45,13 @@ default UserApiDelegate getDelegate() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return getDelegate().createUser(body); } @@ -56,12 +62,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithArrayInput(body); } @@ -72,12 +79,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithListInput(body); } @@ -90,13 +98,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return getDelegate().deleteUser(username); } @@ -109,15 +118,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { return getDelegate().getUserByName(username); } @@ -130,14 +140,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return getDelegate().loginUser(username, password); } @@ -147,10 +158,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return getDelegate().logoutUser(); @@ -166,13 +178,14 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return getDelegate().updateUser(username, body); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 9319e143d793..54a4e7e4ffd5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -2,7 +2,8 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b7f58b90fa6b..86013b3c333a 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 b2da4b9b26a6..868aed4a9571 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 fb134a8c4419..8824dc475202 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 7ee6a9816197..495ca0bf4dc1 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 2e88258ce75c..b882906b48b4 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c2ca28b35414..cb69731bd762 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 @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 80195fc3d4be..e8f0ff889bdd 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6f7a0b5d56e3..b03730404c34 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 @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e91680a724ef..585c5a0d90e2 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 @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 c30fc1653d41..4dbec5747b4a 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 7dd51d7ccd56..ce1338ae159e 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 c1f4cbd00a72..57b09a4d0a35 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 dae97d794675..c391ec3c7556 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index 83b61b77934c..a163fde88a30 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 219c200849f5..d8ddb6945ce3 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "another-fake", description = "the another-fake API") +@Tag(name = "another-fake", description = "the another-fake API") public interface AnotherFakeApi { /** @@ -35,13 +40,14 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java index c331936e9ac6..76e995ceff65 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -38,7 +40,7 @@ public AnotherFakeApiController(@org.springframework.beans.factory.annotation.Au * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - public ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return delegate.call123testSpecialTags(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index a81e1aa6f58a..f94fc204e382 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -1,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 16c00a65a4a8..5059a5685a8a 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -35,7 +40,7 @@ import java.util.Map; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { /** @@ -45,13 +50,14 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); + ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); /** @@ -61,13 +67,14 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); + ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); /** @@ -77,13 +84,14 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); + ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); /** @@ -93,13 +101,14 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); + ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); /** @@ -109,13 +118,14 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body); + ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); /** @@ -125,13 +135,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); + ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); /** @@ -141,13 +152,14 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body); + ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); /** @@ -157,14 +169,15 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); /** @@ -188,16 +201,15 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback); + ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); /** @@ -215,14 +227,15 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); + ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); /** @@ -237,12 +250,13 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); + ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); /** @@ -251,13 +265,14 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param); + ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); /** @@ -267,13 +282,14 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2); + ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); /** @@ -287,12 +303,13 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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); + ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); /** @@ -303,18 +320,14 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); + ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java index 3417a50982e4..012e043e9945 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiController.java @@ -11,7 +11,9 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -48,7 +50,7 @@ public FakeApiController(@org.springframework.beans.factory.annotation.Autowired * @return successful operation (status code 200) * @see FakeApi#createXmlItem */ - public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + public ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return delegate.createXmlItem(xmlItem); } @@ -60,7 +62,7 @@ public ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,requ * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + public ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return delegate.fakeOuterBooleanSerialize(body); } @@ -72,7 +74,7 @@ public ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inpu * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + public ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { return delegate.fakeOuterCompositeSerialize(body); } @@ -84,7 +86,7 @@ public ResponseEntity fakeOuterCompositeSerialize(@ApiParam(valu * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + public ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return delegate.fakeOuterNumberSerialize(body); } @@ -96,7 +98,7 @@ public ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "In * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + public ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return delegate.fakeOuterStringSerialize(body); } @@ -108,7 +110,7 @@ public ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + public ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return delegate.testBodyWithFileSchema(body); } @@ -120,7 +122,7 @@ public ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,require * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ - public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return delegate.testBodyWithQueryParams(query, body); } @@ -132,7 +134,7 @@ public ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = " * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - public ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return delegate.testClientModel(body); } @@ -158,7 +160,7 @@ public ResponseEntity testClientModel(@ApiParam(value = "client model" , * or User not found (status code 404) * @see FakeApi#testEndpointParameters */ - public ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + public ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } @@ -178,7 +180,7 @@ public ResponseEntity testEndpointParameters(@ApiParam(value = "None", req * or Not found (status code 404) * @see FakeApi#testEnumParameters */ - public ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + public ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return delegate.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } @@ -195,7 +197,7 @@ public ResponseEntity testEnumParameters(@ApiParam(value = "Header paramet * @return Someting wrong (status code 400) * @see FakeApi#testGroupParameters */ - public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + public ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return delegate.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); } @@ -206,7 +208,7 @@ public ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Requ * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + public ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return delegate.testInlineAdditionalProperties(param); } @@ -218,7 +220,7 @@ public ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "re * @return successful operation (status code 200) * @see FakeApi#testJsonFormData */ - public ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + public ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return delegate.testJsonFormData(param, param2); } @@ -234,7 +236,7 @@ public ResponseEntity testJsonFormData(@ApiParam(value = "field1", require * @return Success (status code 200) * @see FakeApi#testQueryParameterCollectionFormat */ - public 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) { + public ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return delegate.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } @@ -247,7 +249,7 @@ public ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPara * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - public ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + public ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { return delegate.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 77c9d65965d8..0a018b16c6a0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -11,7 +11,8 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 7d57d6280777..b9a2cf114d8c 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -25,7 +30,7 @@ import java.util.Map; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { /** @@ -35,15 +40,14 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body); + ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java index 176d4d3378d9..8c4ee529f7bb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -1,7 +1,9 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -38,7 +40,7 @@ public FakeClassnameTestApiController(@org.springframework.beans.factory.annotat * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - public ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + public ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { return delegate.testClassname(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fbf48bc9fcfa..5666faacbf50 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -1,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 c8c43b67e00d..7a704bd2fb06 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -27,7 +32,7 @@ import java.util.Map; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { /** @@ -37,19 +42,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -60,18 +61,14 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); + ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); /** @@ -82,19 +79,15 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); /** @@ -106,19 +99,15 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); /** @@ -130,17 +119,16 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); /** @@ -152,21 +140,17 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); + ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); /** @@ -177,18 +161,14 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status); + ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); /** @@ -199,18 +179,14 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); + ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 9d2012ea6707..98aa44c13691 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -3,7 +3,9 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public PetApiController(@org.springframework.beans.factory.annotation.Autowired( * or Invalid input (status code 405) * @see PetApi#addPet */ - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return delegate.addPet(body); } @@ -53,7 +55,7 @@ public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to b * or Invalid pet value (status code 400) * @see PetApi#deletePet */ - public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + public ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return delegate.deletePet(petId, apiKey); } @@ -66,7 +68,7 @@ public ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requi * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - public 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) { + public ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { return delegate.findPetsByStatus(status); } @@ -80,7 +82,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { return delegate.findPetsByTags(tags); } @@ -94,7 +96,7 @@ public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags * or Pet not found (status code 404) * @see PetApi#getPetById */ - public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { return delegate.getPetById(petId); } @@ -108,7 +110,7 @@ public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",re * or Validation exception (status code 405) * @see PetApi#updatePet */ - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + public ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return delegate.updatePet(body); } @@ -121,7 +123,7 @@ public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs t * @return Invalid input (status code 405) * @see PetApi#updatePetWithForm */ - public 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + public ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return delegate.updatePetWithForm(petId, name, status); } @@ -134,7 +136,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @return successful operation (status code 200) * @see PetApi#uploadFile */ - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + public ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { return delegate.uploadFile(petId, additionalMetadata, file); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index da180785c563..95f26cedc0c9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -3,7 +3,8 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 59e47ec85fe4..77298dbfe3a3 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { /** @@ -37,13 +42,14 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId); + ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); /** @@ -52,12 +58,11 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -72,15 +77,16 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId); + ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); /** @@ -90,13 +96,14 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); + ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java index 53b5b7a76dbc..8dc538fe4523 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiController.java @@ -2,7 +2,9 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -40,7 +42,7 @@ public StoreApiController(@org.springframework.beans.factory.annotation.Autowire * or Order not found (status code 404) * @see StoreApi#deleteOrder */ - public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + public ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return delegate.deleteOrder(orderId); } @@ -65,7 +67,7 @@ public ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + public ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { return delegate.getOrderById(orderId); } @@ -77,7 +79,7 @@ public ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "I * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + public ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { return delegate.placeOrder(body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index a3c84b992164..bccec4fb5fa2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -2,7 +2,8 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 6252c2affe3f..6467a130507d 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -26,7 +31,7 @@ import java.util.Map; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { /** @@ -36,12 +41,13 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body); + ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); /** @@ -50,12 +56,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -64,12 +71,13 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body); + ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); /** @@ -80,13 +88,14 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username); + ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); /** @@ -97,15 +106,16 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username); + ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); /** @@ -116,14 +126,15 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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); + ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); /** @@ -131,10 +142,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +160,13 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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); + ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java index ce006c46dc02..9a10b0ae6513 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiController.java @@ -2,7 +2,9 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -39,7 +41,7 @@ public UserApiController(@org.springframework.beans.factory.annotation.Autowired * @return successful operation (status code 200) * @see UserApi#createUser */ - public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + public ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return delegate.createUser(body); } @@ -50,7 +52,7 @@ public ResponseEntity createUser(@ApiParam(value = "Created user object" , * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return delegate.createUsersWithArrayInput(body); } @@ -61,7 +63,7 @@ public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + public ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return delegate.createUsersWithListInput(body); } @@ -74,7 +76,7 @@ public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * or User not found (status code 404) * @see UserApi#deleteUser */ - public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + public ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return delegate.deleteUser(username); } @@ -87,7 +89,7 @@ public ResponseEntity deleteUser(@ApiParam(value = "The name that needs to * or User not found (status code 404) * @see UserApi#getUserByName */ - public ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + public ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { return delegate.getUserByName(username); } @@ -100,7 +102,7 @@ public ResponseEntity getUserByName(@ApiParam(value = "The name that needs * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - public 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) { + public ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return delegate.loginUser(username, password); } @@ -124,7 +126,7 @@ public ResponseEntity logoutUser() { * or User not found (status code 404) * @see UserApi#updateUser */ - public 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) { + public ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return delegate.updateUser(username, body); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index 021cbf1ad7b9..400b1e62b799 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -2,7 +2,8 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b9d1c52f961a..82eec5480e3f 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 a76320466a38..b0d2df447641 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 df4610324400..75e222a26592 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 d57bb6c1de46..d9cf10c60d7a 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 ab7b747bf2fa..9afea2d563fe 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e0887e113301..e275f4968651 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 @@ -3,13 +3,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 java.util.UUID; import org.springframework.core.io.Resource; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 c9b418c6901b..6b5ba4771d1b 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6c0fe72d4773..47d95a8be224 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 @@ -3,14 +3,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.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; import org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 26b38944e11a..14384258d87b 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 @@ -4,9 +4,8 @@ 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 org.threeten.bp.OffsetDateTime; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 e91bc5697c75..8d83137623ec 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b88e00b47d78..e0ef7edf918a 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 85694fed2185..02096983e0d3 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 ca74cfcfd91c..f3d9550f40ba 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-implicitHeaders/pom.xml b/samples/server/petstore/springboot-implicitHeaders/pom.xml index 320db0c02a0e..f84461e15afa 100644 --- a/samples/server/petstore/springboot-implicitHeaders/pom.xml +++ b/samples/server/petstore/springboot-implicitHeaders/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 ae3ccec1f0df..f041f733b092 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @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() { @@ -43,16 +48,18 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 b7a747d465de..d50cde96207e 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -39,7 +44,7 @@ import java.util.Optional; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default Optional getRequest() { @@ -53,15 +58,17 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -74,15 +81,17 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -95,15 +104,17 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -125,15 +136,17 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -146,15 +159,17 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -167,15 +182,17 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -188,15 +205,17 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -209,16 +228,18 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -254,18 +275,18 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -284,10 +305,12 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + } @ApiImplicitParams({ @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), @ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") @@ -295,7 +318,7 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -311,16 +334,18 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Query paramet * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + } @ApiImplicitParams({ @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required=true, dataType = "Boolean", paramType = "header"), @ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") }) @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - 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) Integer stringGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -332,15 +357,17 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -353,15 +380,17 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -378,14 +407,16 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -399,21 +430,18 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 b28f3e50cfde..2d7069593024 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default Optional getRequest() { @@ -43,18 +48,18 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 635f4aa5e1f0..0f27c5bbff94 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -45,21 +50,18 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,21 +74,18 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + } @ApiImplicitParams({ @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -100,21 +99,18 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -143,21 +139,18 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -186,19 +179,19 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -227,23 +220,20 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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") }) + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -257,20 +247,17 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -284,21 +271,18 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 9519543518eb..14f55d589b39 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -45,15 +50,17 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -65,11 +72,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/store/inventory", @@ -90,17 +97,19 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -127,16 +136,18 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 76929df8c663..b9f90dd548b8 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -44,14 +49,16 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,14 +70,16 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -82,14 +91,16 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -103,15 +114,17 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -125,17 +138,19 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -163,16 +178,18 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -183,9 +200,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/logout", @@ -205,15 +224,17 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b7f58b90fa6b..86013b3c333a 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 b2da4b9b26a6..868aed4a9571 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 fb134a8c4419..8824dc475202 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 7ee6a9816197..495ca0bf4dc1 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 2e88258ce75c..b882906b48b4 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c2ca28b35414..cb69731bd762 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 @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 80195fc3d4be..e8f0ff889bdd 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6f7a0b5d56e3..b03730404c34 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 @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e91680a724ef..585c5a0d90e2 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 @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 c30fc1653d41..4dbec5747b4a 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 7dd51d7ccd56..ce1338ae159e 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 c1f4cbd00a72..57b09a4d0a35 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 dae97d794675..c391ec3c7556 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 4e18946be43c..41b2fc48ecac 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -41,11 +41,6 @@ swagger-ui 3.14.2 - - io.swagger - swagger-annotations - 1.5.14 - com.google.code.findbugs 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 63478103bb73..b9a0c1cad2e1 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 @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -28,7 +33,7 @@ import java.util.Map; @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() { @@ -42,14 +47,15 @@ default AnotherFakeApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default Mono> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().call123testSpecialTags(body, exchange); } 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 b3b75e8872b8..87d856b28dcb 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,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 d4669be75cda..098653b87260 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -38,7 +43,7 @@ import java.util.Map; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default FakeApiDelegate getDelegate() { @@ -52,13 +57,14 @@ default FakeApiDelegate getDelegate() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default Mono> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody Mono xmlItem, ServerWebExchange exchange) { + default Mono> createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody Mono xmlItem, ServerWebExchange exchange) { return getDelegate().createXmlItem(xmlItem, exchange); } @@ -70,13 +76,14 @@ default Mono> createXmlItem(@ApiParam(value = "XmlItem Body * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default Mono> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); } @@ -88,13 +95,14 @@ default Mono> fakeOuterBooleanSerialize(@ApiParam(value * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default Mono> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { return getDelegate().fakeOuterCompositeSerialize(body, exchange); } @@ -106,13 +114,14 @@ default Mono> fakeOuterCompositeSerialize(@ApiPar * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default Mono> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { return getDelegate().fakeOuterNumberSerialize(body, exchange); } @@ -124,13 +133,14 @@ default Mono> fakeOuterNumberSerialize(@ApiParam(valu * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default Mono> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { return getDelegate().fakeOuterStringSerialize(body, exchange); } @@ -142,13 +152,14 @@ default Mono> fakeOuterStringSerialize(@ApiParam(value = * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default Mono> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().testBodyWithFileSchema(body, exchange); } @@ -160,13 +171,14 @@ default Mono> testBodyWithFileSchema(@ApiParam(value = "" , * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default Mono> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().testBodyWithQueryParams(query, body, exchange); } @@ -178,14 +190,15 @@ default Mono> testBodyWithQueryParams(@NotNull @ApiParam(va * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default Mono> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().testClientModel(body, exchange); } @@ -211,16 +224,15 @@ default Mono> testClientModel(@ApiParam(value = "client m * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default Mono> testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback, ServerWebExchange exchange) { + default Mono> testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback, ServerWebExchange exchange) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); } @@ -240,14 +252,15 @@ default Mono> testEndpointParameters(@ApiParam(value = "Non * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default Mono> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, ServerWebExchange exchange) { + default Mono> testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, ServerWebExchange exchange) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); } @@ -264,12 +277,13 @@ default Mono> testEnumParameters(@ApiParam(value = "Header * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { + default Mono> testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } @@ -280,13 +294,14 @@ default Mono> testGroupParameters(@NotNull @ApiParam(value * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default Mono> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Mono param, ServerWebExchange exchange) { + default Mono> testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Mono param, ServerWebExchange exchange) { return getDelegate().testInlineAdditionalProperties(param, exchange); } @@ -298,13 +313,14 @@ default Mono> testInlineAdditionalProperties(@ApiParam(valu * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default Mono> testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2, ServerWebExchange exchange) { + default Mono> testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2, ServerWebExchange exchange) { return getDelegate().testJsonFormData(param, param2, exchange); } @@ -320,12 +336,13 @@ default Mono> testJsonFormData(@ApiParam(value = "field1", * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - default Mono> 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, ServerWebExchange exchange) { + default Mono> testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context, ServerWebExchange exchange) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); } @@ -338,19 +355,15 @@ default Mono> testQueryParameterCollectionFormat(@NotNull @ * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) { + default Mono> uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, ServerWebExchange exchange) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); } 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 2f4d5ac28753..aa8734391c99 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 @@ -11,7 +11,8 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 d0da9e5f4ec7..562a133663af 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 @@ -6,7 +6,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -28,7 +33,7 @@ import java.util.Map; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default FakeClassnameTestApiDelegate getDelegate() { @@ -42,16 +47,15 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default Mono> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().testClassname(body, exchange); } 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 f273c4040bc0..d7b673ee3eee 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,7 +1,8 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 f13bc9fa4abe..9501686f8d28 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -30,7 +35,7 @@ import java.util.Map; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default PetApiDelegate getDelegate() { @@ -44,19 +49,15 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default Mono> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().addPet(body, exchange); } @@ -69,18 +70,14 @@ default Mono> addPet(@ApiParam(value = "Pet object that nee * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default Mono> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, ServerWebExchange exchange) { + default Mono> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey, ServerWebExchange exchange) { return getDelegate().deletePet(petId, apiKey, exchange); } @@ -93,19 +90,15 @@ default Mono> deletePet(@ApiParam(value = "Pet id to delete * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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, ServerWebExchange exchange) { + default Mono>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status, ServerWebExchange exchange) { return getDelegate().findPetsByStatus(status, exchange); } @@ -119,19 +112,15 @@ default Mono>> findPetsByStatus(@NotNull @ApiParam(valu * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, ServerWebExchange exchange) { + default Mono>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags, ServerWebExchange exchange) { return getDelegate().findPetsByTags(tags, exchange); } @@ -145,17 +134,16 @@ default Mono>> findPetsByTags(@NotNull @ApiParam(value * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Mono> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId, ServerWebExchange exchange) { + default Mono> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId, ServerWebExchange exchange) { return getDelegate().getPetById(petId, exchange); } @@ -169,21 +157,17 @@ default Mono> getPetById(@ApiParam(value = "ID of pet to ret * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default Mono> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().updatePet(body, exchange); } @@ -196,18 +180,14 @@ default Mono> updatePet(@ApiParam(value = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status, ServerWebExchange exchange) { + default Mono> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status, ServerWebExchange exchange) { return getDelegate().updatePetWithForm(petId, name, status, exchange); } @@ -220,19 +200,15 @@ default Mono> updatePetWithForm(@ApiParam(value = "ID of pe * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default Mono> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file, ServerWebExchange exchange) { + default Mono> uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file, ServerWebExchange exchange) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); } 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 69511f246743..4fb45e19b62d 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 @@ -3,7 +3,8 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 5f3210558d8b..c623a4ef068b 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 @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -29,7 +34,7 @@ import java.util.Map; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default StoreApiDelegate getDelegate() { @@ -44,13 +49,14 @@ default StoreApiDelegate getDelegate() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default Mono> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId, ServerWebExchange exchange) { + default Mono> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId, ServerWebExchange exchange) { return getDelegate().deleteOrder(orderId, exchange); } @@ -61,12 +67,11 @@ default Mono> deleteOrder(@ApiParam(value = "ID of the orde * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default Mono>> getInventory(ServerWebExchange exchange) { @@ -83,15 +88,16 @@ default Mono>> getInventory(ServerWebExchang * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId, ServerWebExchange exchange) { + default Mono> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId, ServerWebExchange exchange) { return getDelegate().getOrderById(orderId, exchange); } @@ -103,14 +109,15 @@ default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(val * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default Mono> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().placeOrder(body, exchange); } 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 7aad4e8fc2e4..f5e21ee1b7a9 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 @@ -2,7 +2,8 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 0b01b7f29934..e0987032c604 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 @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.CookieValue; @@ -29,7 +34,7 @@ import java.util.Map; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default UserApiDelegate getDelegate() { @@ -43,12 +48,13 @@ default UserApiDelegate getDelegate() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default Mono> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().createUser(body, exchange); } @@ -59,12 +65,13 @@ default Mono> createUser(@ApiParam(value = "Created user ob * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default Mono> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { + default Mono> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { return getDelegate().createUsersWithArrayInput(body, exchange); } @@ -75,12 +82,13 @@ default Mono> createUsersWithArrayInput(@ApiParam(value = " * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default Mono> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { + default Mono> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { return getDelegate().createUsersWithListInput(body, exchange); } @@ -93,13 +101,14 @@ default Mono> createUsersWithListInput(@ApiParam(value = "L * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default Mono> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username, ServerWebExchange exchange) { + default Mono> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username, ServerWebExchange exchange) { return getDelegate().deleteUser(username, exchange); } @@ -112,15 +121,16 @@ default Mono> deleteUser(@ApiParam(value = "The name that n * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Mono> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username, ServerWebExchange exchange) { + default Mono> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username, ServerWebExchange exchange) { return getDelegate().getUserByName(username, exchange); } @@ -133,14 +143,15 @@ default Mono> getUserByName(@ApiParam(value = "The name tha * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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, ServerWebExchange exchange) { + default Mono> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password, ServerWebExchange exchange) { return getDelegate().loginUser(username, password, exchange); } @@ -150,10 +161,11 @@ default Mono> loginUser(@NotNull @ApiParam(value = "The u * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default Mono> logoutUser(ServerWebExchange exchange) { return getDelegate().logoutUser(exchange); @@ -169,13 +181,14 @@ default Mono> logoutUser(ServerWebExchange exchange) { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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 body, ServerWebExchange exchange) { + default Mono> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().updateUser(username, body, exchange); } 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 6b8e3d5d8180..9e3d31e69628 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 @@ -2,7 +2,8 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b7f58b90fa6b..86013b3c333a 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 b2da4b9b26a6..868aed4a9571 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 fb134a8c4419..8824dc475202 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 7ee6a9816197..495ca0bf4dc1 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 2e88258ce75c..b882906b48b4 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c2ca28b35414..cb69731bd762 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 @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 80195fc3d4be..e8f0ff889bdd 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6f7a0b5d56e3..b03730404c34 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 @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e91680a724ef..585c5a0d90e2 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 @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 c30fc1653d41..4dbec5747b4a 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 7dd51d7ccd56..ce1338ae159e 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 c1f4cbd00a72..57b09a4d0a35 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 dae97d794675..c391ec3c7556 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index 76bec66a453b..b17e14cac29e 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 27c8e569d3f7..65f4740bc51c 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @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() { @@ -43,14 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 e7a34da6e08f..7dc7363abda5 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -39,7 +44,7 @@ import java.util.Optional; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default Optional getRequest() { @@ -53,13 +58,14 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,13 +78,14 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,13 +98,14 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -119,13 +127,14 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,13 +147,14 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -157,13 +167,14 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,13 +187,14 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -195,14 +207,15 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -238,16 +251,15 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -268,14 +280,15 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - 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) 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=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) Optional> enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) Optional enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") Optional enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -293,12 +306,13 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Optional booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -310,13 +324,14 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -329,13 +344,14 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -352,12 +368,13 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,19 +388,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 1aa913b3f22e..d5e698d2b779 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default Optional getRequest() { @@ -43,16 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 99dd6c46785e..8b44dcc8d091 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -45,19 +50,15 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -71,18 +72,14 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - 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) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) Optional apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,19 +93,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -137,19 +130,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -178,17 +167,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,21 +205,17 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,18 +229,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -270,19 +250,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 065462225ab8..7049253cccb1 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -45,13 +50,14 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,12 +69,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -86,15 +91,16 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,14 +127,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 9123fb350a95..0b8acf16d830 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -44,12 +49,13 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,12 +67,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,12 +85,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,13 +105,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -117,15 +126,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -153,14 +163,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -171,10 +182,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -191,13 +203,14 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } 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 448c77cea931..2bb2a9d8b557 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 a80499fd79b9..6c18ec800a17 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 @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 d8db9baf3105..7c1817d8c26f 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 @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 b7f58b90fa6b..86013b3c333a 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 @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 b2da4b9b26a6..868aed4a9571 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 fb134a8c4419..8824dc475202 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 @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 9bc946d6cc1a..018c492a2343 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 @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { 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 e1346fe63ea8..7bf8478e1cb2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { 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 f6d3c17d0be3..d9dd35d2cc0f 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { 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 db3f8e08dc0d..d38268331306 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 ba96dc2add68..e629558ddd33 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 59d479c85336..a6f5ae46f310 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { 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 02e027c3feea..cafc2475a0af 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 @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { 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 7ee6a9816197..495ca0bf4dc1 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 @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { 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 ef4719c757f0..20fc4c146cc6 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 8eff3e0c49aa..0a947d475d6b 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 @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 2e88258ce75c..b882906b48b4 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 @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c2ca28b35414..cb69731bd762 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 @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 c0e7dd75528e..e0ccd50d7253 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { 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 80195fc3d4be..e8f0ff889bdd 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 @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { 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 6f7a0b5d56e3..b03730404c34 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 @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 04606fb90460..d429586a876f 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { 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 1d385b21bd4d..bd50387c2d06 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { 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 82026635f5cb..b31b09ec67e5 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { 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 1180f019ea3f..8c16d7e0aea6 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { 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 4423a2ac631d..3bec692c1b36 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid 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 e91680a724ef..585c5a0d90e2 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 @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { 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 61dbaaefeeae..73a490ce3fb6 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 @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { 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 6b5abc576b07..3eb6a8fc3319 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 @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; 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 c30fc1653d41..4dbec5747b4a 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 @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum 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 4e1c3e681095..9a561070c4e2 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { 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 6c0bfa749d3d..04ff14e1e652 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$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 c72064ce0428..fb71f3181345 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { 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 7dd51d7ccd56..ce1338ae159e 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull 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 c1f4cbd00a72..57b09a4d0a35 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull 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 d195089778a9..d01e4cfe4e97 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 @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { 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 dae97d794675..c391ec3c7556 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 @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml index 809f9c1f9aac..4c4b9b4ac62f 100644 --- a/samples/server/petstore/springboot-virtualan/pom.xml +++ b/samples/server/petstore/springboot-virtualan/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 2091ead1ec6e..029e5ad4e7db 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -6,7 +6,12 @@ package org.openapitools.virtualan.api; import org.openapitools.virtualan.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "another-fake", description = "the another-fake API") +@Tag(name = "another-fake", description = "the another-fake API") @VirtualService public interface AnotherFakeApi { @@ -47,14 +52,15 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 6734a6b6afb7..5ba39068e346 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.virtualan.model.User; import org.openapitools.virtualan.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -41,7 +46,7 @@ import java.util.Optional; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") @VirtualService public interface FakeApi { @@ -57,13 +62,14 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -77,13 +83,14 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @return Output boolean (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,13 +104,14 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @return Output composite (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -126,13 +134,14 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @return Output number (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -146,13 +155,14 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @return Output string (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -166,13 +176,14 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @return Success (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -186,13 +197,14 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @return Success (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -206,14 +218,15 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -250,16 +263,15 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * or User not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -281,14 +293,15 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * or Not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -307,12 +320,13 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame * @return Someting wrong (status code 400) */ @ApiVirtual - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -325,13 +339,14 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -345,13 +360,14 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -369,12 +385,13 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @return Success (status code 200) */ @ApiVirtual - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -389,19 +406,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 0e613980a27c..8417ecdfabc4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -6,7 +6,12 @@ package org.openapitools.virtualan.api; import org.openapitools.virtualan.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") @VirtualService public interface FakeClassnameTestApi { @@ -47,16 +52,15 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 6fd27fb073ec..49f15da5cd7c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -8,7 +8,12 @@ import org.openapitools.virtualan.model.ModelApiResponse; import org.openapitools.virtualan.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -33,7 +38,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") @VirtualService public interface PetApi { @@ -49,19 +54,15 @@ default Optional getRequest() { * or Invalid input (status code 405) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -76,18 +77,14 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * or Invalid pet value (status code 400) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -102,19 +99,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * or Invalid status value (status code 400) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -144,19 +137,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * @deprecated */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -186,17 +175,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Pet not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -226,21 +214,17 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Validation exception (status code 405) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -255,18 +239,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @return Invalid input (status code 405) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -281,19 +261,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 6fc9017f442c..4424a1ae382a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -7,7 +7,12 @@ import java.util.Map; import org.openapitools.virtualan.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -32,7 +37,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") @VirtualService public interface StoreApi { @@ -49,13 +54,14 @@ default Optional getRequest() { * or Order not found (status code 404) */ @ApiVirtual - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -68,12 +74,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -92,15 +97,16 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -128,14 +134,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * or Invalid Order (status code 400) */ @ApiVirtual - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index f48096bebff6..2346b7aa4a0b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -7,7 +7,12 @@ import java.util.List; import org.openapitools.virtualan.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; import org.springframework.http.HttpStatus; @@ -32,7 +37,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") @VirtualService public interface UserApi { @@ -48,12 +53,13 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -66,12 +72,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -84,12 +91,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -104,13 +112,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * or User not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -125,15 +134,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or User not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -162,14 +172,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * or Invalid username/password supplied (status code 400) */ @ApiVirtual - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -181,10 +192,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * @return successful operation (status code 200) */ @ApiVirtual - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -202,13 +214,14 @@ default ResponseEntity logoutUser() { * or User not found (status code 404) */ @ApiVirtual - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java index bc5960e9e2a0..7613b342fdf7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java index 2cfbb24d2edf..83d083f17d1b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java index 8e55722065f4..ec15ff82fe23 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index c74b4c4dc8d9..21ee73dd7416 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index c621a5abdd83..77d9bb5898c2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index a1c0e06ea614..1df80b02ca8f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.virtualan.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java index aad86c60481e..32f78f586351 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCat.java @@ -4,10 +4,9 @@ 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 org.openapitools.virtualan.model.BigCatAllOf; import org.openapitools.virtualan.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java index b98ba1e2fa12..f16099bb8c06 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java index 37fbab45b5de..a939d224bf1e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Capitalization.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java index 11b3fdcac09c..6dfc0f41926b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Cat.java @@ -3,10 +3,9 @@ import java.util.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.virtualan.model.Animal; import org.openapitools.virtualan.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java index aee739099baf..b96b7d9739a9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java index 1de7ecef165d..547cfb43bf84 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java index c9963672df27..9abfe36b08c8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ClassModel.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java index bdfe8ab1441d..6645bea5bde1 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Client.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java index 1cbf5a5cbc0a..d4c1843d4ad5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Dog.java @@ -3,10 +3,9 @@ import java.util.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.virtualan.model.Animal; import org.openapitools.virtualan.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java index adb89e08f8a3..08805c307c29 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index d2346d758a63..d4266042801f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java index 02adc43755a7..b0cca16981f5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumClass.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java index cc61c7818af9..3f203752b3ad 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumTest.java @@ -4,9 +4,8 @@ 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 org.openapitools.virtualan.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index a3eb0b9febc7..47236d721289 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index fc9b0feb4d64..12d8c4dc93da 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java index 722c0d1e398c..f3b74fd242f5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index 0e2354891e5b..b0492029ee4e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0bbe7b8446fe..e834adf3dac4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.virtualan.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java index 83cc4f8174cb..e5558c878c7e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Model200Response.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java index 8ff519aea3e7..723cabfbf5fe 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java index 16f683d95dc7..e948ecc7033c 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ModelReturn.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java index fd419b60a0cf..67b9bc214b89 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Name.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java index 494ac9d66d95..fd4d035ae7a6 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/NumberOnly.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java index 2df7246dbb5f..89820ced1056 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Order.java @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java index cdff3253b98d..a90c3bd463a4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterComposite.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java index ef0bba51c505..50e35f8eeea5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/OuterEnum.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index 052fdc5308bb..18baf2676338 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.virtualan.model.Category; import org.openapitools.virtualan.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java index 2526f0d1f72f..40ea33e054d8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index b4bc84c7b910..275a936ebc62 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java index b833cfcd350a..7089bb036d3a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index 99ab478b4724..6e9ea5ee4698 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index 484e8f018b95..f52e7053bce9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java index b5a97b806c97..4f17f8e222e7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index ac1ba8ac6353..f389a655823e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index 6d6b85134aea..1ef71c793398 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -10,6 +10,7 @@ ${java.version} ${java.version} 2.8.0 + 2.1.1 org.springframework.boot @@ -48,6 +49,11 @@ springfox-swagger-ui ${springfox-version} + + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} + javax.xml.bind jaxb-api 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 27c8e569d3f7..65f4740bc51c 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @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() { @@ -43,14 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/another-fake/dummy", + @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + tags={ "$another-fake?", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity call123testSpecialTags(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 c0321cb6c939..c8ea7c803760 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 @@ -16,7 +16,12 @@ import org.springframework.core.io.Resource; import org.openapitools.model.User; import org.openapitools.model.XmlItem; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -39,7 +44,7 @@ import java.util.Optional; @Validated -@Api(value = "fake", description = "the fake API") +@Tag(name = "fake", description = "the fake API") public interface FakeApi { default Optional getRequest() { @@ -53,13 +58,14 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "creates an XmlItem", nickname = "createXmlItem", notes = "this route creates an XmlItem", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/create_xml_item", + @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) - default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { + default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,13 +78,14 @@ default ResponseEntity createXmlItem(@ApiParam(value = "XmlItem Body" ,req * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) }) - @RequestMapping(value = "/fake/outer/boolean", + @Operation(summary = "", description = "Test serialization of outer boolean types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { + default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -91,13 +98,14 @@ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Inp * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - @RequestMapping(value = "/fake/outer/composite", + @Operation(summary = "", description = "Test serialization of object with outer number type", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -119,13 +127,14 @@ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(val * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) }) - @RequestMapping(value = "/fake/outer/number", + @Operation(summary = "", description = "Test serialization of outer number types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { + default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,13 +147,14 @@ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "I * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) }) - @RequestMapping(value = "/fake/outer/string", + @Operation(summary = "", description = "Test serialization of outer string types", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) - default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { + default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -157,13 +167,14 @@ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-file-schema", + @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -176,13 +187,14 @@ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,requir * @param body (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/body-with-query-params", + @Operation(summary = "", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) - default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -195,14 +207,15 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClientModel(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -238,16 +251,15 @@ default ResponseEntity testClientModel(@ApiParam(value = "client model" * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", authorizations = { - @Authorization(value = "http_basic_test") - }, tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true) @RequestPart(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true) @RequestPart(value="double", required=true) Double _double,@ApiParam(value = "None", required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true) @RequestPart(value="byte", required=true) byte[] _byte,@ApiParam(value = "None") @RequestPart(value="integer", required=false) Integer integer,@ApiParam(value = "None") @RequestPart(value="int32", required=false) Integer int32,@ApiParam(value = "None") @RequestPart(value="int64", required=false) Long int64,@ApiParam(value = "None") @RequestPart(value="float", required=false) Float _float,@ApiParam(value = "None") @RequestPart(value="string", required=false) String string,@ApiParam(value = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@ApiParam(value = "None") @RequestPart(value="date", required=false) LocalDate date,@ApiParam(value = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None") @RequestPart(value="password", required=false) String password,@ApiParam(value = "None") @RequestPart(value="callback", required=false) String paramCallback) { + default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -268,14 +280,15 @@ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", re * @return Invalid request (status code 400) * or Not found (status code 404) */ - @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request"), - @ApiResponse(code = 404, message = "Not found") }) - @RequestMapping(value = "/fake", + @Operation(summary = "To test enum parameters", description = "To test enum parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid request" ) , + @ApiResponse(responseCode = "404", description = "Not found" ) }) + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) 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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { + default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -293,12 +306,13 @@ default ResponseEntity testEnumParameters(@ApiParam(value = "Header parame * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", nickname = "testGroupParameters", notes = "Fake endpoint to test group parameters (optional)", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Someting wrong") }) - @RequestMapping(value = "/fake", + @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) - default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@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) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { + default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -310,13 +324,14 @@ default ResponseEntity testGroupParameters(@NotNull @ApiParam(value = "Req * @param param request body (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @Operation(summary = "test inline additionalProperties", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) - default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map param) { + default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -329,13 +344,14 @@ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "r * @param param2 field2 (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/fake/jsonFormData", + @Operation(summary = "test json serialization of form data", description = "", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) - default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true) @RequestPart(value="param", required=true) String param,@ApiParam(value = "field2", required=true) @RequestPart(value="param2", required=true) String param2) { + default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -352,12 +368,13 @@ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", requir * @param context (required) * @return Success (status code 200) */ - @ApiOperation(value = "", nickname = "testQueryParameterCollectionFormat", notes = "To test the collection format in query parameters", tags={ "fake", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success") }) - @RequestMapping(value = "/fake/test-query-paramters", + @Operation(summary = "", description = "To test the collection format in query parameters", + tags={ "fake", }, + responses = { + @ApiResponse(responseCode = "200", description = "Success" ) }) + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) - 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) { + default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -371,19 +388,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @ApiPar * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @Operation(summary = "uploads an image (required)", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { + default ResponseEntity uploadFileWithRequiredFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "file to upload") @Valid @RequestPart(value = "requiredFile") MultipartFile requiredFile,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 1aa913b3f22e..d5e698d2b779 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,12 @@ package org.openapitools.api; import org.openapitools.model.Client; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -29,7 +34,7 @@ import java.util.Optional; @Validated -@Api(value = "fake_classname_test", description = "the fake_classname_test API") +@Tag(name = "fake_classname_test", description = "the fake_classname_test API") public interface FakeClassnameTestApi { default Optional getRequest() { @@ -43,16 +48,15 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "fake_classname_tags 123#$%^", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - @RequestMapping(value = "/fake_classname_test", + @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + tags={ "fake_classname_tags 123#$%^", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) - default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) { + default ResponseEntity testClassname(@Parameter(description = "client model" ,required=true ) @Valid @RequestBody Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 b68809eabc37..6d281fbede4e 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 @@ -8,7 +8,12 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -31,7 +36,7 @@ import java.util.Optional; @Validated -@Api(value = "pet", description = "the pet API") +@Tag(name = "pet", description = "the pet API") public interface PetApi { default Optional getRequest() { @@ -45,19 +50,15 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet", + @Operation(summary = "Add a new pet to the store", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -71,18 +72,14 @@ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation"), - @ApiResponse(code = 400, message = "Invalid pet value") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Deletes a pet", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) , + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) - default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { + default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -96,19 +93,15 @@ default ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",requ * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") }) - @RequestMapping(value = "/pet/findByStatus", + @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -137,19 +130,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") }) - @RequestMapping(value = "/pet/findByTags", + @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -178,17 +167,16 @@ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tag * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { - @Authorization(value = "api_key") - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Find pet by ID", description = "Returns a single pet", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) { + default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -217,21 +205,17 @@ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",r * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @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(value = "/pet", + @Operation(summary = "Update an existing pet", description = "", + tags={ "pet", }, + 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" ) }) + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { + default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -245,18 +229,14 @@ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input") }) - @RequestMapping(value = "/pet/{petId}", + @Operation(summary = "Updates a pet in the store with form data", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - 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") @RequestPart(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { + default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -270,19 +250,15 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that * @param file file to upload (optional) * @return successful operation (status code 200) */ - @ApiOperation(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") - }) - }, tags={ "pet", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @Operation(summary = "uploads an image", description = "", + tags={ "pet", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { + default ResponseEntity uploadFile(@Parameter(in = ParameterIn.PATH,description = "ID of pet to update", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Additional data to pass to server") @RequestPart(value="additionalMetadata", required=false) String additionalMetadata,@Parameter(description = "file to upload") @Valid @RequestPart(value = "file") MultipartFile file) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 065462225ab8..7049253cccb1 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,12 @@ import java.util.Map; import org.openapitools.model.Order; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "store", description = "the store API") +@Tag(name = "store", description = "the store API") public interface StoreApi { default Optional getRequest() { @@ -45,13 +50,14 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(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", tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) - default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) { + default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -63,12 +69,11 @@ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that * * @return successful operation (status code 200) */ - @ApiOperation(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") - }, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) - @RequestMapping(value = "/store/inventory", + @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -86,15 +91,16 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @ApiOperation(value = "Find purchase order by ID", nickname = "getOrderById", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") }) - @RequestMapping(value = "/store/order/{order_id}", + @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Order not found" ) }) + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId) { + default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -121,14 +127,15 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @ApiParam(value = " * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") }) - @RequestMapping(value = "/store/order", + @Operation(summary = "Place an order for a pet", description = "", + tags={ "store", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - default ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { + default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { 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 9123fb350a95..0b8acf16d830 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,12 @@ import java.util.List; import org.openapitools.model.User; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.*; +import io.swagger.v3.oas.annotations.enums.*; +import io.swagger.v3.oas.annotations.media.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -30,7 +35,7 @@ import java.util.Optional; @Validated -@Api(value = "user", description = "the user API") +@Tag(name = "user", description = "the user API") public interface UserApi { default Optional getRequest() { @@ -44,12 +49,13 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user", + @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user", method = RequestMethod.POST) - default ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody User body) { + default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -61,12 +67,13 @@ default ResponseEntity createUser(@ApiParam(value = "Created user object" * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithArray", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) - default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,12 +85,13 @@ default ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List o * @param body List of user object (required) * @return successful operation (status code 200) */ - @ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/createWithList", + @Operation(summary = "Creates list of users with given input array", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) - default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody List body) { + default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -97,13 +105,14 @@ default ResponseEntity createUsersWithListInput(@ApiParam(value = "List of * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) - default ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username) { + default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -117,15 +126,16 @@ default ResponseEntity deleteUser(@ApiParam(value = "The name that needs t * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Get user by user name", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username) { + default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -153,14 +163,15 @@ default ResponseEntity getUserByName(@ApiParam(value = "The name that need * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") }) - @RequestMapping(value = "/user/login", + @Operation(summary = "Logs user into the system", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - 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) { + default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -171,10 +182,11 @@ default ResponseEntity loginUser(@NotNull @ApiParam(value = "The user na * * @return successful operation (status code 200) */ - @ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation") }) - @RequestMapping(value = "/user/logout", + @Operation(summary = "Logs out current logged in user session", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -191,13 +203,14 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") }) - @RequestMapping(value = "/user/{username}", + @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , + @ApiResponse(responseCode = "404", description = "User not found" ) }) + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) - 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) { + default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 448c77cea931..2bb2a9d8b557 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesAnyType name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java index a80499fd79b9..6c18ec800a17 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -3,11 +3,10 @@ import java.util.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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public AdditionalPropertiesArray name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java index d8db9baf3105..7c1817d8c26f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -3,10 +3,9 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public AdditionalPropertiesBoolean name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b7f58b90fa6b..86013b3c333a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -3,12 +3,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 java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -76,7 +75,7 @@ public AdditionalPropertiesClass putMapStringItem(String key, String mapStringIt * Get mapString * @return mapString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapString() { @@ -104,7 +103,7 @@ public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumb * Get mapNumber * @return mapNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -133,7 +132,7 @@ public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntege * Get mapInteger * @return mapInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapInteger() { @@ -161,7 +160,7 @@ public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBoolea * Get mapBoolean * @return mapBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapBoolean() { @@ -189,7 +188,7 @@ public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List * Get mapArrayAnytype * @return mapArrayAnytype */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -247,7 +246,7 @@ public AdditionalPropertiesClass putMapMapStringItem(String key, Map arrayAr * Get arrayArrayNumber * @return arrayArrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index b2da4b9b26a6..868aed4a9571 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -38,7 +37,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { * Get arrayNumber * @return arrayNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java index fb134a8c4419..8824dc475202 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTest.java @@ -3,11 +3,10 @@ import java.util.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.List; import org.openapitools.model.ReadOnlyFirst; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -46,7 +45,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { * Get arrayOfString * @return arrayOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayOfString() { @@ -74,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) * Get arrayArrayOfInteger * @return arrayArrayOfInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -103,7 +102,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI * Get arrayArrayOfModel * @return arrayArrayOfModel */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java index 9bc946d6cc1a..018c492a2343 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCat.java @@ -4,10 +4,9 @@ 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 org.openapitools.model.BigCatAllOf; import org.openapitools.model.Cat; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -68,7 +67,7 @@ public BigCat kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java index 9a57d85eecad..2ee66127d4fb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/BigCatAllOf.java @@ -4,8 +4,7 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -66,7 +65,7 @@ public BigCatAllOf kind(KindEnum kind) { * Get kind * @return kind */ - @ApiModelProperty(value = "") + @Schema(description = "") public KindEnum getKind() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java index e1346fe63ea8..7bf8478e1cb2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Capitalization.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -41,7 +40,7 @@ public Capitalization smallCamel(String smallCamel) { * Get smallCamel * @return smallCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallCamel() { @@ -61,7 +60,7 @@ public Capitalization capitalCamel(String capitalCamel) { * Get capitalCamel * @return capitalCamel */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalCamel() { @@ -81,7 +80,7 @@ public Capitalization smallSnake(String smallSnake) { * Get smallSnake * @return smallSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getSmallSnake() { @@ -101,7 +100,7 @@ public Capitalization capitalSnake(String capitalSnake) { * Get capitalSnake * @return capitalSnake */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getCapitalSnake() { @@ -121,7 +120,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { * Get scAETHFlowPoints * @return scAETHFlowPoints */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getScAETHFlowPoints() { @@ -141,7 +140,7 @@ public Capitalization ATT_NAME(String ATT_NAME) { * Name of the pet * @return ATT_NAME */ - @ApiModelProperty(value = "Name of the pet ") + @Schema(description = "Name of the pet ") public String getATTNAME() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java index f6d3c17d0be3..d9dd35d2cc0f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Cat.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.CatAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Cat declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java index cf145ae53718..aceece5504c2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/CatAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public CatAllOf declawed(Boolean declawed) { * Get declawed * @return declawed */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getDeclawed() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java index db3f8e08dc0d..d38268331306 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Category.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Category id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Category name(String name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java index ba96dc2add68..e629558ddd33 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ClassModel.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model with \"_class\" property */ -@ApiModel(description = "Model for testing model with \"_class\" property") +@Schema(description = "Model for testing model with \"_class\" property") public class ClassModel { @JsonProperty("_class") @@ -27,7 +26,7 @@ public ClassModel propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java index 59d479c85336..a6f5ae46f310 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Client.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public Client client(String client) { * Get client * @return client */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getClient() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java index 02e027c3feea..cafc2475a0af 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Dog.java @@ -3,10 +3,9 @@ import java.util.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.model.Animal; import org.openapitools.model.DogAllOf; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,7 +27,7 @@ public Dog breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java index a1c4c17d8907..cb6c9e94a833 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/DogAllOf.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public DogAllOf breed(String breed) { * Get breed * @return breed */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBreed() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java index 7ee6a9816197..495ca0bf4dc1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArrays.java @@ -4,10 +4,9 @@ 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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -103,7 +102,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) { * Get justSymbol * @return justSymbol */ - @ApiModelProperty(value = "") + @Schema(description = "") public JustSymbolEnum getJustSymbol() { @@ -131,7 +130,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { * Get arrayEnum * @return arrayEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getArrayEnum() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java index ef4719c757f0..20fc4c146cc6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumClass.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java index 8eff3e0c49aa..0a947d475d6b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumTest.java @@ -4,9 +4,8 @@ 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 org.openapitools.model.OuterEnum; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -184,7 +183,7 @@ public EnumTest enumString(EnumStringEnum enumString) { * Get enumString * @return enumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumStringEnum getEnumString() { @@ -204,7 +203,7 @@ public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { * Get enumStringRequired * @return enumStringRequired */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -225,7 +224,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) { * Get enumInteger * @return enumInteger */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumIntegerEnum getEnumInteger() { @@ -245,7 +244,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) { * Get enumNumber * @return enumNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") public EnumNumberEnum getEnumNumber() { @@ -265,7 +264,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { * Get outerEnum * @return outerEnum */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 2e88258ce75c..b882906b48b4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -3,10 +3,9 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public FileSchemaTestClass file(java.io.File file) { * Get file * @return file */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -61,7 +60,7 @@ public FileSchemaTestClass addFilesItem(java.io.File filesItem) { * Get files * @return files */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index c2ca28b35414..cb69731bd762 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -3,13 +3,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 java.time.LocalDate; import java.time.OffsetDateTime; import java.util.UUID; import org.springframework.core.io.Resource; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -72,7 +71,7 @@ public FormatTest integer(Integer integer) { * maximum: 100 * @return integer */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(10) @Max(100) public Integer getInteger() { @@ -94,7 +93,7 @@ public FormatTest int32(Integer int32) { * maximum: 200 * @return int32 */ - @ApiModelProperty(value = "") + @Schema(description = "") @Min(20) @Max(200) public Integer getInt32() { @@ -114,7 +113,7 @@ public FormatTest int64(Long int64) { * Get int64 * @return int64 */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getInt64() { @@ -136,7 +135,7 @@ public FormatTest number(BigDecimal number) { * maximum: 543.2 * @return number */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -160,7 +159,7 @@ public FormatTest _float(Float _float) { * maximum: 987.6 * @return _float */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -182,7 +181,7 @@ public FormatTest _double(Double _double) { * maximum: 123.4 * @return _double */ - @ApiModelProperty(value = "") + @Schema(description = "") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -202,7 +201,7 @@ public FormatTest string(String string) { * Get string * @return string */ - @ApiModelProperty(value = "") + @Schema(description = "") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -222,7 +221,7 @@ public FormatTest _byte(byte[] _byte) { * Get _byte * @return _byte */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @@ -243,7 +242,7 @@ public FormatTest binary(Resource binary) { * Get binary * @return binary */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -264,7 +263,7 @@ public FormatTest date(LocalDate date) { * Get date * @return date */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -286,7 +285,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -307,7 +306,7 @@ public FormatTest uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @Valid @@ -328,7 +327,7 @@ public FormatTest password(String password) { * Get password * @return password */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Size(min=10,max=64) @@ -349,7 +348,7 @@ public FormatTest bigDecimal(BigDecimal bigDecimal) { * Get bigDecimal * @return bigDecimal */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java index c0e7dd75528e..e0ccd50d7253 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/HasOnlyReadOnly.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public HasOnlyReadOnly bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public HasOnlyReadOnly foo(String foo) { * Get foo * @return foo */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getFoo() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java index 80195fc3d4be..e8f0ff889bdd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTest.java @@ -4,11 +4,10 @@ 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.List; import java.util.Map; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -86,7 +85,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr * Get mapMapOfString * @return mapMapOfString */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -115,7 +114,7 @@ public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) * Get mapOfEnumString * @return mapOfEnumString */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getMapOfEnumString() { @@ -143,7 +142,7 @@ public MapTest putDirectMapItem(String key, Boolean directMapItem) { * Get directMap * @return directMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getDirectMap() { @@ -171,7 +170,7 @@ public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { * Get indirectMap * @return indirectMap */ - @ApiModelProperty(value = "") + @Schema(description = "") public Map getIndirectMap() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 6f7a0b5d56e3..b03730404c34 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,14 +3,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.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import org.openapitools.model.Animal; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -39,7 +38,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { * Get uuid * @return uuid */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -60,7 +59,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT * Get dateTime * @return dateTime */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -89,7 +88,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal * Get map * @return map */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java index 04606fb90460..d429586a876f 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Model200Response.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name starting with number */ -@ApiModel(description = "Model for testing model name starting with number") +@Schema(description = "Model for testing model name starting with number") public class Model200Response { @JsonProperty("name") @@ -30,7 +29,7 @@ public Model200Response name(Integer name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getName() { @@ -50,7 +49,7 @@ public Model200Response propertyClass(String propertyClass) { * Get propertyClass * @return propertyClass */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPropertyClass() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java index 1d385b21bd4d..bd50387c2d06 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelApiResponse.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -32,7 +31,7 @@ public ModelApiResponse code(Integer code) { * Get code * @return code */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getCode() { @@ -52,7 +51,7 @@ public ModelApiResponse type(String type) { * Get type * @return type */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getType() { @@ -72,7 +71,7 @@ public ModelApiResponse message(String message) { * Get message * @return message */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMessage() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java index 82026635f5cb..b31b09ec67e5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ModelReturn.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing reserved words */ -@ApiModel(description = "Model for testing reserved words") +@Schema(description = "Model for testing reserved words") public class ModelReturn { @JsonProperty("return") @@ -27,7 +26,7 @@ public ModelReturn _return(Integer _return) { * Get _return * @return _return */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getReturn() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java index 1180f019ea3f..8c16d7e0aea6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Name.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -12,7 +11,7 @@ /** * Model for testing model name same as property name */ -@ApiModel(description = "Model for testing model name same as property name") +@Schema(description = "Model for testing model name same as property name") public class Name { @JsonProperty("name") @@ -36,7 +35,7 @@ public Name name(Integer name) { * Get name * @return name */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -57,7 +56,7 @@ public Name snakeCase(Integer snakeCase) { * Get snakeCase * @return snakeCase */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer getSnakeCase() { @@ -77,7 +76,7 @@ public Name property(String property) { * Get property * @return property */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getProperty() { @@ -97,7 +96,7 @@ public Name _123number(Integer _123number) { * Get _123number * @return _123number */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public Integer get123number() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java index 4423a2ac631d..3bec692c1b36 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/NumberOnly.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,7 +26,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { * Get justNumber * @return justNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java index e91680a724ef..585c5a0d90e2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Order.java @@ -4,9 +4,8 @@ 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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -80,7 +79,7 @@ public Order id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -100,7 +99,7 @@ public Order petId(Long petId) { * Get petId * @return petId */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getPetId() { @@ -120,7 +119,7 @@ public Order quantity(Integer quantity) { * Get quantity * @return quantity */ - @ApiModelProperty(value = "") + @Schema(description = "") public Integer getQuantity() { @@ -140,7 +139,7 @@ public Order shipDate(OffsetDateTime shipDate) { * Get shipDate * @return shipDate */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -161,7 +160,7 @@ public Order status(StatusEnum status) { * Order Status * @return status */ - @ApiModelProperty(value = "Order Status") + @Schema(description = "Order Status") public StatusEnum getStatus() { @@ -181,7 +180,7 @@ public Order complete(Boolean complete) { * Get complete * @return complete */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getComplete() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java index 61dbaaefeeae..73a490ce3fb6 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterComposite.java @@ -3,9 +3,8 @@ import java.util.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 io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -33,7 +32,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { * Get myNumber * @return myNumber */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -54,7 +53,7 @@ public OuterComposite myString(String myString) { * Get myString * @return myString */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getMyString() { @@ -74,7 +73,7 @@ public OuterComposite myBoolean(Boolean myBoolean) { * Get myBoolean * @return myBoolean */ - @ApiModelProperty(value = "") + @Schema(description = "") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java index 6b5abc576b07..3eb6a8fc3319 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/OuterEnum.java @@ -2,6 +2,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..4dbec5747b4a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -4,12 +4,11 @@ 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.List; import org.openapitools.model.Category; import org.openapitools.model.Tag; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -85,7 +84,7 @@ public Pet id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -105,7 +104,7 @@ public Pet category(Category category) { * Get category * @return category */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -126,7 +125,7 @@ public Pet name(String name) { * Get name * @return name */ - @ApiModelProperty(example = "doggie", required = true, value = "") + @Schema(example = "doggie", required = true, description = "") @NotNull @@ -152,7 +151,7 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * Get photoUrls * @return photoUrls */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -181,7 +180,7 @@ public Pet addTagsItem(Tag tagsItem) { * Get tags * @return tags */ - @ApiModelProperty(value = "") + @Schema(description = "") @Valid @@ -202,7 +201,7 @@ public Pet status(StatusEnum status) { * pet status in the store * @return status */ - @ApiModelProperty(value = "pet status in the store") + @Schema(description = "pet status in the store") public StatusEnum getStatus() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java index 4e1c3e681095..9a561070c4e2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ReadOnlyFirst.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public ReadOnlyFirst bar(String bar) { * Get bar * @return bar */ - @ApiModelProperty(readOnly = true, value = "") + @Schema(readOnly = true, description = "") public String getBar() { @@ -49,7 +48,7 @@ public ReadOnlyFirst baz(String baz) { * Get baz * @return baz */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getBaz() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java index 6c0bfa749d3d..04ff14e1e652 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelName.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -26,7 +25,7 @@ public class SpecialModelName { * Get $specialPropertyName * @return $specialPropertyName */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java index c72064ce0428..fb71f3181345 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Tag.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -29,7 +28,7 @@ public Tag id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -49,7 +48,7 @@ public Tag name(String name) { * Get name * @return name */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getName() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java index 7dd51d7ccd56..ce1338ae159e 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -42,7 +41,7 @@ public TypeHolderDefault stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -63,7 +62,7 @@ public TypeHolderDefault numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @Valid @@ -85,7 +84,7 @@ public TypeHolderDefault integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -106,7 +105,7 @@ public TypeHolderDefault boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull @@ -132,7 +131,7 @@ public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(required = true, value = "") + @Schema(required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java index c1f4cbd00a72..57b09a4d0a35 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -45,7 +44,7 @@ public TypeHolderExample stringItem(String stringItem) { * Get stringItem * @return stringItem */ - @ApiModelProperty(example = "what", required = true, value = "") + @Schema(example = "what", required = true, description = "") @NotNull @@ -66,7 +65,7 @@ public TypeHolderExample numberItem(BigDecimal numberItem) { * Get numberItem * @return numberItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @Valid @@ -88,7 +87,7 @@ public TypeHolderExample floatItem(Float floatItem) { * Get floatItem * @return floatItem */ - @ApiModelProperty(example = "1.234", required = true, value = "") + @Schema(example = "1.234", required = true, description = "") @NotNull @@ -109,7 +108,7 @@ public TypeHolderExample integerItem(Integer integerItem) { * Get integerItem * @return integerItem */ - @ApiModelProperty(example = "-2", required = true, value = "") + @Schema(example = "-2", required = true, description = "") @NotNull @@ -130,7 +129,7 @@ public TypeHolderExample boolItem(Boolean boolItem) { * Get boolItem * @return boolItem */ - @ApiModelProperty(example = "true", required = true, value = "") + @Schema(example = "true", required = true, description = "") @NotNull @@ -156,7 +155,7 @@ public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { * Get arrayItem * @return arrayItem */ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @Schema(example = "[0, 1, 2, 3]", required = true, description = "") @NotNull diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java index d195089778a9..d01e4cfe4e97 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/User.java @@ -3,8 +3,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -47,7 +46,7 @@ public User id(Long id) { * Get id * @return id */ - @ApiModelProperty(value = "") + @Schema(description = "") public Long getId() { @@ -67,7 +66,7 @@ public User username(String username) { * Get username * @return username */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getUsername() { @@ -87,7 +86,7 @@ public User firstName(String firstName) { * Get firstName * @return firstName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getFirstName() { @@ -107,7 +106,7 @@ public User lastName(String lastName) { * Get lastName * @return lastName */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getLastName() { @@ -127,7 +126,7 @@ public User email(String email) { * Get email * @return email */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getEmail() { @@ -147,7 +146,7 @@ public User password(String password) { * Get password * @return password */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPassword() { @@ -167,7 +166,7 @@ public User phone(String phone) { * Get phone * @return phone */ - @ApiModelProperty(value = "") + @Schema(description = "") public String getPhone() { @@ -187,7 +186,7 @@ public User userStatus(Integer userStatus) { * User Status * @return userStatus */ - @ApiModelProperty(value = "User Status") + @Schema(description = "User Status") public Integer getUserStatus() { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java index dae97d794675..c391ec3c7556 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItem.java @@ -3,11 +3,10 @@ import java.util.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.List; +import io.swagger.v3.oas.annotations.media.Schema; import org.openapitools.jackson.nullable.JsonNullable; import javax.validation.Valid; import javax.validation.constraints.*; @@ -122,7 +121,7 @@ public XmlItem attributeString(String attributeString) { * Get attributeString * @return attributeString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getAttributeString() { @@ -142,7 +141,7 @@ public XmlItem attributeNumber(BigDecimal attributeNumber) { * Get attributeNumber * @return attributeNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -163,7 +162,7 @@ public XmlItem attributeInteger(Integer attributeInteger) { * Get attributeInteger * @return attributeInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getAttributeInteger() { @@ -183,7 +182,7 @@ public XmlItem attributeBoolean(Boolean attributeBoolean) { * Get attributeBoolean * @return attributeBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getAttributeBoolean() { @@ -211,7 +210,7 @@ public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { * Get wrappedArray * @return wrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getWrappedArray() { @@ -231,7 +230,7 @@ public XmlItem nameString(String nameString) { * Get nameString * @return nameString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNameString() { @@ -251,7 +250,7 @@ public XmlItem nameNumber(BigDecimal nameNumber) { * Get nameNumber * @return nameNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -272,7 +271,7 @@ public XmlItem nameInteger(Integer nameInteger) { * Get nameInteger * @return nameInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNameInteger() { @@ -292,7 +291,7 @@ public XmlItem nameBoolean(Boolean nameBoolean) { * Get nameBoolean * @return nameBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNameBoolean() { @@ -320,7 +319,7 @@ public XmlItem addNameArrayItem(Integer nameArrayItem) { * Get nameArray * @return nameArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameArray() { @@ -348,7 +347,7 @@ public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { * Get nameWrappedArray * @return nameWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNameWrappedArray() { @@ -368,7 +367,7 @@ public XmlItem prefixString(String prefixString) { * Get prefixString * @return prefixString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixString() { @@ -388,7 +387,7 @@ public XmlItem prefixNumber(BigDecimal prefixNumber) { * Get prefixNumber * @return prefixNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -409,7 +408,7 @@ public XmlItem prefixInteger(Integer prefixInteger) { * Get prefixInteger * @return prefixInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixInteger() { @@ -429,7 +428,7 @@ public XmlItem prefixBoolean(Boolean prefixBoolean) { * Get prefixBoolean * @return prefixBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixBoolean() { @@ -457,7 +456,7 @@ public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { * Get prefixArray * @return prefixArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixArray() { @@ -485,7 +484,7 @@ public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { * Get prefixWrappedArray * @return prefixWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixWrappedArray() { @@ -505,7 +504,7 @@ public XmlItem namespaceString(String namespaceString) { * Get namespaceString * @return namespaceString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getNamespaceString() { @@ -525,7 +524,7 @@ public XmlItem namespaceNumber(BigDecimal namespaceNumber) { * Get namespaceNumber * @return namespaceNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -546,7 +545,7 @@ public XmlItem namespaceInteger(Integer namespaceInteger) { * Get namespaceInteger * @return namespaceInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getNamespaceInteger() { @@ -566,7 +565,7 @@ public XmlItem namespaceBoolean(Boolean namespaceBoolean) { * Get namespaceBoolean * @return namespaceBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getNamespaceBoolean() { @@ -594,7 +593,7 @@ public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { * Get namespaceArray * @return namespaceArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceArray() { @@ -622,7 +621,7 @@ public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { * Get namespaceWrappedArray * @return namespaceWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getNamespaceWrappedArray() { @@ -642,7 +641,7 @@ public XmlItem prefixNsString(String prefixNsString) { * Get prefixNsString * @return prefixNsString */ - @ApiModelProperty(example = "string", value = "") + @Schema(example = "string", description = "") public String getPrefixNsString() { @@ -662,7 +661,7 @@ public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { * Get prefixNsNumber * @return prefixNsNumber */ - @ApiModelProperty(example = "1.234", value = "") + @Schema(example = "1.234", description = "") @Valid @@ -683,7 +682,7 @@ public XmlItem prefixNsInteger(Integer prefixNsInteger) { * Get prefixNsInteger * @return prefixNsInteger */ - @ApiModelProperty(example = "-2", value = "") + @Schema(example = "-2", description = "") public Integer getPrefixNsInteger() { @@ -703,7 +702,7 @@ public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { * Get prefixNsBoolean * @return prefixNsBoolean */ - @ApiModelProperty(example = "true", value = "") + @Schema(example = "true", description = "") public Boolean getPrefixNsBoolean() { @@ -731,7 +730,7 @@ public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { * Get prefixNsArray * @return prefixNsArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsArray() { @@ -759,7 +758,7 @@ public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { * Get prefixNsWrappedArray * @return prefixNsWrappedArray */ - @ApiModelProperty(value = "") + @Schema(description = "") public List getPrefixNsWrappedArray() { From 4592a0081b15ee571072a5fdee19e6bfa12849d7 Mon Sep 17 00:00:00 2001 From: Alexej Date: Sun, 8 Mar 2020 14:07:51 +0100 Subject: [PATCH 3/5] Fix OpenAPITools#4245 handling security with io.swagger.core.v3 in version 2.1.1 fixed comment --- .../codegen/languages/SpringCodegen.java | 2 +- .../src/main/resources/JavaSpring/api.mustache | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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 a0cd2b6ccae4..0968dec22a35 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 @@ -824,7 +824,7 @@ public void setUnhandledException(boolean unhandledException) { @Override public CodegenModel fromModel(String name, Schema model) { CodegenModel codegenModel = super.fromModel(name, model); - // Remove io.swagger.annotations.ApiModel import + // Remove io.swagger.annotations.ApiModel and io.swagger.annotations.ApiModelProperty imports codegenModel.imports.remove("ApiModel"); codegenModel.imports.remove("ApiModelProperty"); return codegenModel; diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 7b6aee3a1286..1daf379aa2d0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.enums.*; import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; {{#jdk8-no-delegate}} {{#virtualService}} @@ -112,11 +113,18 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} - @Operation(summary = "{{{summary}}}", description = "{{{notes}}}", + @Operation(summary = "{{{summary}}}", operationId = "{{{operationId}}}", description = "{{{notes}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }, + {{#hasAuthMethods}} + {{#authMethods}}security = @SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes = { + {{#scopes}} "{{scope}}" {{#hasMore}}, + {{/hasMore}} {{/scopes}} + }{{/isOAuth}}){{#hasMore}}, + {{/hasMore}}{{/authMethods}}, + {{/hasAuthMethods}} responses = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}" {{#baseType}}, content = { @Content( {{#containerType}}schema = @Schema(implementation = {{{baseType}}}.class){{/containerType}}{{^containerType}} array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class)) {{/containerType}} )} {{/baseType}} ){{#hasMore}} ,{{/hasMore}} {{/responses}} }) - {{#implicitHeaders}}} + {{#implicitHeaders}} @ApiImplicitParams({ {{#headerParams}} {{>implicitHeader}} From d31703c1d2911b37bbf26073b094b368e7a3fa41 Mon Sep 17 00:00:00 2001 From: Alexej Date: Sun, 8 Mar 2020 14:09:42 +0100 Subject: [PATCH 4/5] Fix OpenAPITools#4245 updated spring samples handling security for client and server to use swagger-annotations 2.1.1 --- .../java/spring/SpringCodegenTest.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 4 +- .../java/org/openapitools/api/FakeApi.java | 51 ++++++-------- .../api/FakeClassnameTestApi.java | 5 +- .../java/org/openapitools/api/PetApi.java | 54 ++++++++++----- .../java/org/openapitools/api/StoreApi.java | 14 ++-- .../java/org/openapitools/api/UserApi.java | 25 +++---- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- .../virtualan/api/AnotherFakeApi.java | 5 +- .../openapitools/virtualan/api/FakeApi.java | 66 ++++++++++--------- .../virtualan/api/FakeClassnameTestApi.java | 6 +- .../openapitools/virtualan/api/PetApi.java | 62 ++++++++++++----- .../openapitools/virtualan/api/StoreApi.java | 18 ++--- .../openapitools/virtualan/api/UserApi.java | 33 +++++----- .../org/openapitools/api/AnotherFakeApi.java | 5 +- .../java/org/openapitools/api/FakeApi.java | 66 ++++++++++--------- .../api/FakeClassnameTestApi.java | 6 +- .../java/org/openapitools/api/PetApi.java | 62 ++++++++++++----- .../java/org/openapitools/api/StoreApi.java | 18 ++--- .../java/org/openapitools/api/UserApi.java | 33 +++++----- 76 files changed, 1462 insertions(+), 936 deletions(-) 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 a8f75d7cbe3c..14fd79abeb34 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 @@ -281,7 +281,9 @@ public void testMultipartBoot() throws IOException { // Check that the api handles the array final String multipartArrayApi = files.get("/src/main/java/org/openapitools/api/MultipartArrayApi.java"); Assert.assertTrue(multipartArrayApi.contains("List files")); - Assert.assertTrue(multipartArrayApi.contains("@ApiParam(value = \"Many files\")")); + Assert.assertTrue(multipartArrayApi.contains("@Parameter(description = \"Many files\")")); + Assert.assertTrue(multipartArrayApi.contains("operationId = \"multipartArray\"")); + Assert.assertTrue(multipartArrayApi.contains("ApiResponse(responseCode")); Assert.assertTrue(multipartArrayApi.contains("@RequestPart(value = \"files\")")); // Check that the delegate handles the single file @@ -291,7 +293,7 @@ public void testMultipartBoot() throws IOException { // Check that the api handles the single file final String multipartSingleApi = files.get("/src/main/java/org/openapitools/api/MultipartSingleApi.java"); Assert.assertTrue(multipartSingleApi.contains("MultipartFile file")); - Assert.assertTrue(multipartSingleApi.contains("@ApiParam(value = \"One file\")")); + Assert.assertTrue(multipartSingleApi.contains("@Parameter(description = \"One file\")")); Assert.assertTrue(multipartSingleApi.contains("@RequestPart(value = \"file\")")); } diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 829a8ffa76aa..15631f88abb7 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -46,11 +47,15 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) CompletableFuture> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -63,11 +68,15 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) CompletableFuture> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -80,12 +89,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) CompletableFuture>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); @@ -100,12 +113,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) CompletableFuture>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); @@ -120,13 +137,14 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) CompletableFuture> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); @@ -140,13 +158,17 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) , @ApiResponse(responseCode = "405", description = "Validation exception" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) CompletableFuture> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -160,11 +182,15 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) CompletableFuture> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@Parameter( description = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); @@ -178,11 +204,15 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index bd181b738ff9..a4ee76db0876 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -47,12 +48,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) CompletableFuture> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId); @@ -63,11 +64,12 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) CompletableFuture>> getInventory(); @@ -82,13 +84,13 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) CompletableFuture> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId); @@ -101,12 +103,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) CompletableFuture> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 4401506d0c35..6b8a28cd40b7 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -46,11 +47,11 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) CompletableFuture> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -61,11 +62,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) CompletableFuture> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -76,11 +77,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) CompletableFuture> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -93,12 +94,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) CompletableFuture> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); @@ -111,13 +112,13 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) CompletableFuture> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); @@ -131,12 +132,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) CompletableFuture> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); @@ -147,11 +148,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) CompletableFuture> logoutUser(); @@ -165,12 +166,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) CompletableFuture> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); 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 c2b0de7f3685..d3558a7f8016 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -45,11 +46,15 @@ public interface PetApi { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -62,11 +67,15 @@ public interface PetApi { * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) com.netflix.hystrix.HystrixCommand> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -79,12 +88,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); @@ -99,12 +112,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); @@ -119,13 +136,14 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); @@ -139,13 +157,17 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) , @ApiResponse(responseCode = "405", description = "Validation exception" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) com.netflix.hystrix.HystrixCommand> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -159,11 +181,15 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter( description = "Updated name of the pet" ) @RequestParam(value="name", required=false) String name,@Parameter( description = "Updated status of the pet" ) @RequestParam(value="status", required=false) String status); @@ -177,11 +203,15 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) 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 4980c04e87e8..f704beb10fa6 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -46,12 +47,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) com.netflix.hystrix.HystrixCommand> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId); @@ -62,11 +63,12 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand>> getInventory(); @@ -81,13 +83,13 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId); @@ -100,12 +102,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); 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 631165d5b0a9..f76aa7cfd780 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -45,11 +46,11 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -60,11 +61,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -75,11 +76,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) com.netflix.hystrix.HystrixCommand> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -92,12 +93,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) com.netflix.hystrix.HystrixCommand> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); @@ -110,13 +111,13 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); @@ -130,12 +131,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); @@ -146,11 +147,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> logoutUser(); @@ -164,12 +165,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) com.netflix.hystrix.HystrixCommand> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 5a1e42450f0a..6a1a7601e2e4 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,15 @@ default Optional getRequest() { * @param body Pet object that needs to be added to the store (required) * @return Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -69,11 +74,15 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @param apiKey (optional) * @return Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -89,12 +98,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -126,12 +139,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -163,13 +180,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -200,13 +218,17 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) , @ApiResponse(responseCode = "405", description = "Validation exception" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -223,11 +245,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded", method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -244,11 +270,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 13725f63d455..029e36da18b6 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,12 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -69,11 +70,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = "application/json", method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -91,13 +93,13 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{orderId}", + @RequestMapping(value = "/store/order/{orderId}", produces = "application/json", method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") Long orderId) { @@ -127,12 +129,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = "application/json", method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 08a7ac0c5da9..7a4e2da6912b 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,11 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -67,11 +68,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,11 +86,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -105,12 +106,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,13 +127,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = "application/json", method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -163,12 +164,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = "application/json", method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -182,11 +183,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -203,12 +204,12 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 08387dae1953..dda13ba23d12 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,11 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 0a06b5f5dbd3..94a1a2ef17e3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -59,11 +60,11 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default CompletableFuture> createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -79,11 +80,11 @@ default CompletableFuture> createXmlItem(@Parameter(descrip * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -99,11 +100,11 @@ default CompletableFuture> fakeOuterBooleanSerialize(@Pa * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -130,11 +131,11 @@ default CompletableFuture> fakeOuterCompositeSeri * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -150,11 +151,11 @@ default CompletableFuture> fakeOuterNumberSerialize(@ * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default CompletableFuture> fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -170,11 +171,11 @@ default CompletableFuture> fakeOuterStringSerialize(@Para * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default CompletableFuture> testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -190,11 +191,11 @@ default CompletableFuture> testBodyWithFileSchema(@Paramete * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default CompletableFuture> testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -210,11 +211,11 @@ default CompletableFuture> testBodyWithQueryParams(@NotNull * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -256,12 +257,13 @@ default CompletableFuture> testClientModel(@Parameter(des * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default CompletableFuture> testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -285,12 +287,12 @@ default CompletableFuture> testEndpointParameters(@Paramete * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default CompletableFuture> testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -311,11 +313,11 @@ default CompletableFuture> testEnumParameters(@Parameter(in * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default CompletableFuture> testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -329,11 +331,11 @@ default CompletableFuture> testGroupParameters(@NotNull @Pa * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default CompletableFuture> testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -349,11 +351,11 @@ default CompletableFuture> testInlineAdditionalProperties(@ * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default CompletableFuture> testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -373,11 +375,11 @@ default CompletableFuture> testJsonFormData(@Parameter(desc * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default CompletableFuture> testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -393,11 +395,15 @@ default CompletableFuture> testQueryParameterCollectionForm * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9baee9561b0f..246946cfc7ac 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,12 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 0996f0e10f9c..09e02b6bb2c7 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -51,12 +52,16 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default CompletableFuture> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -73,12 +78,16 @@ default CompletableFuture> addPet(@Parameter(description = * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default CompletableFuture> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -94,12 +103,16 @@ default CompletableFuture> deletePet(@Parameter(in = Parame * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -133,12 +146,16 @@ default CompletableFuture>> findPetsByStatus(@NotNull @ * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -172,13 +189,14 @@ default CompletableFuture>> findPetsByTags(@NotNull @Pa * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -212,14 +230,18 @@ default CompletableFuture> getPetById(@Parameter(in = Parame * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default CompletableFuture> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -236,11 +258,15 @@ default CompletableFuture> updatePet(@Parameter(description * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default CompletableFuture> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -257,11 +283,15 @@ default CompletableFuture> updatePetWithForm(@Parameter(in * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 960ce4e5b717..175f77f19672 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -51,12 +52,12 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default CompletableFuture> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -70,11 +71,12 @@ default CompletableFuture> deleteOrder(@Parameter(in = Para * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default CompletableFuture>> getInventory() { @@ -92,13 +94,13 @@ default CompletableFuture>> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -130,12 +132,12 @@ default CompletableFuture> getOrderById(@Min(1L) @Max(5L) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default CompletableFuture> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index a16a3a757c60..405fdec2492f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,11 +51,11 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default CompletableFuture> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -68,11 +69,11 @@ default CompletableFuture> createUser(@Parameter(descriptio * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default CompletableFuture> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -86,11 +87,11 @@ default CompletableFuture> createUsersWithArrayInput(@Param * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default CompletableFuture> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -106,12 +107,12 @@ default CompletableFuture> createUsersWithListInput(@Parame * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default CompletableFuture> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -127,13 +128,13 @@ default CompletableFuture> deleteUser(@Parameter(in = Param * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -166,12 +167,12 @@ default CompletableFuture> getUserByName(@Parameter(in = Pa * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default CompletableFuture> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -185,11 +186,11 @@ default CompletableFuture> loginUser(@NotNull @Parameter( * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default CompletableFuture> logoutUser() { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); @@ -206,12 +207,12 @@ default CompletableFuture> logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default CompletableFuture> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED)); diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 65f4740bc51c..1751b2166d6e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,11 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 6194391da3b8..738d72d1e7fb 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -58,11 +59,11 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -78,11 +79,11 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -98,11 +99,11 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -127,11 +128,11 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -147,11 +148,11 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -167,11 +168,11 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -187,11 +188,11 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -207,11 +208,11 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -251,12 +252,13 @@ default ResponseEntity testClientModel(@Parameter(description = "client * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) LocalDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -280,12 +282,12 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -306,11 +308,11 @@ default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEAD * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -324,11 +326,11 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -344,11 +346,11 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -368,11 +370,11 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -388,11 +390,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d5e698d2b779..1e14807b5384 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,12 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 6d281fbede4e..0fe77c699c0c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,16 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -72,12 +77,16 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -93,12 +102,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -130,12 +143,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -167,13 +184,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -205,14 +223,18 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -229,11 +251,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -250,11 +276,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 7049253cccb1..152d75fd68e4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,12 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -69,11 +70,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -91,13 +93,13 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -127,12 +129,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 0b8acf16d830..5df1285ff344 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,11 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -67,11 +68,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,11 +86,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -105,12 +106,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,13 +127,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -163,12 +164,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -182,11 +183,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -203,12 +204,12 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index d8ddb6945ce3..66d8b5f673f2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,11 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index 5059a5685a8a..fee0bbc79437 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -50,11 +51,11 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); @@ -67,11 +68,11 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); @@ -84,11 +85,11 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); @@ -101,11 +102,11 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); @@ -118,11 +119,11 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); @@ -135,11 +136,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); @@ -152,11 +153,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); @@ -169,11 +170,11 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -201,12 +202,13 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); @@ -227,12 +229,12 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); @@ -250,11 +252,11 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -265,11 +267,11 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); @@ -282,11 +284,11 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); @@ -303,11 +305,11 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); @@ -320,11 +322,15 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index b9a2cf114d8c..c7498ad276e1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,12 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 7a704bd2fb06..cc7d5b8efddf 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -61,12 +66,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -79,12 +88,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); @@ -99,12 +112,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); @@ -119,13 +136,14 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); @@ -140,14 +158,18 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -161,11 +183,15 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); @@ -179,11 +205,15 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 77298dbfe3a3..1bfa99980f82 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); @@ -58,11 +59,12 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -77,13 +79,13 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); @@ -96,12 +98,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 6467a130507d..248dafb61359 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -41,11 +42,11 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -56,11 +57,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -71,11 +72,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -88,12 +89,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); @@ -106,13 +107,13 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); @@ -126,12 +127,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); @@ -142,11 +143,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -160,12 +161,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); 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 d8ddb6945ce3..66d8b5f673f2 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,11 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 5059a5685a8a..fee0bbc79437 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -50,11 +51,11 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); @@ -67,11 +68,11 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); @@ -84,11 +85,11 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); @@ -101,11 +102,11 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); @@ -118,11 +119,11 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); @@ -135,11 +136,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); @@ -152,11 +153,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); @@ -169,11 +170,11 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -201,12 +202,13 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); @@ -227,12 +229,12 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); @@ -250,11 +252,11 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -265,11 +267,11 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); @@ -282,11 +284,11 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); @@ -303,11 +305,11 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); @@ -320,11 +322,15 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 b9a2cf114d8c..c7498ad276e1 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,12 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 7a704bd2fb06..cc7d5b8efddf 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -61,12 +66,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -79,12 +88,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); @@ -99,12 +112,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); @@ -119,13 +136,14 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); @@ -140,14 +158,18 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -161,11 +183,15 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); @@ -179,11 +205,15 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 77298dbfe3a3..1bfa99980f82 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); @@ -58,11 +59,12 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -77,13 +79,13 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); @@ -96,12 +98,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); 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 6467a130507d..248dafb61359 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -41,11 +42,11 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -56,11 +57,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -71,11 +72,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -88,12 +89,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); @@ -106,13 +107,13 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); @@ -126,12 +127,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); @@ -142,11 +143,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -160,12 +161,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); 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 7bea4f5644f8..ad065823b6ff 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -44,11 +45,11 @@ default AnotherFakeApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 cceeeb60d6d7..21120ce21648 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -54,11 +55,11 @@ default FakeApiDelegate getDelegate() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -73,11 +74,11 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -92,11 +93,11 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -111,11 +112,11 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -130,11 +131,11 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -149,11 +150,11 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -168,11 +169,11 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -187,11 +188,11 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -221,12 +222,13 @@ default ResponseEntity testClientModel(@Parameter(description = "client * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -249,12 +251,12 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -274,11 +276,11 @@ default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEAD * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); @@ -291,11 +293,11 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -310,11 +312,11 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -333,11 +335,11 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); @@ -352,11 +354,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 824cc2c37074..ecf465e1de4a 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -44,11 +45,12 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 c09bfedff2fc..657774e6903b 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -46,12 +47,16 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -67,12 +72,16 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return getDelegate().deletePet(petId, apiKey); @@ -87,12 +96,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -109,12 +122,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -131,13 +148,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -154,14 +172,18 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -177,11 +199,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -197,11 +223,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 0fb7d8ff0521..d178f43ee219 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -46,12 +47,12 @@ default StoreApiDelegate getDelegate() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return getDelegate().deleteOrder(orderId); @@ -64,11 +65,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -85,13 +87,13 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -106,12 +108,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { 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 d5df488b8e24..5ac01ce2f6b6 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -45,11 +46,11 @@ default UserApiDelegate getDelegate() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return getDelegate().createUser(body); @@ -62,11 +63,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithArrayInput(body); @@ -79,11 +80,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return getDelegate().createUsersWithListInput(body); @@ -98,12 +99,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return getDelegate().deleteUser(username); @@ -118,13 +119,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -140,12 +141,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -158,11 +159,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return getDelegate().logoutUser(); @@ -178,12 +179,12 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return getDelegate().updateUser(username, body); 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 d8ddb6945ce3..66d8b5f673f2 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,11 @@ public interface AnotherFakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 5059a5685a8a..fee0bbc79437 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -50,11 +51,11 @@ public interface FakeApi { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem); @@ -67,11 +68,11 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body); @@ -84,11 +85,11 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body); @@ -101,11 +102,11 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body); @@ -118,11 +119,11 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body); @@ -135,11 +136,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body); @@ -152,11 +153,11 @@ public interface FakeApi { * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body); @@ -169,11 +170,11 @@ public interface FakeApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -201,12 +202,13 @@ public interface FakeApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback); @@ -227,12 +229,12 @@ public interface FakeApi { * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString); @@ -250,11 +252,11 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group); @@ -265,11 +267,11 @@ public interface FakeApi { * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param); @@ -282,11 +284,11 @@ public interface FakeApi { * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2); @@ -303,11 +305,11 @@ public interface FakeApi { * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context); @@ -320,11 +322,15 @@ public interface FakeApi { * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 b9a2cf114d8c..c7498ad276e1 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -40,11 +41,12 @@ public interface FakeClassnameTestApi { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 7a704bd2fb06..cc7d5b8efddf 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -61,12 +66,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -79,12 +88,16 @@ public interface PetApi { * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status); @@ -99,12 +112,16 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags); @@ -119,13 +136,14 @@ public interface PetApi { * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId); @@ -140,14 +158,18 @@ public interface PetApi { * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body); @@ -161,11 +183,15 @@ public interface PetApi { * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status); @@ -179,11 +205,15 @@ public interface PetApi { * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 77298dbfe3a3..1bfa99980f82 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -42,12 +43,12 @@ public interface StoreApi { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId); @@ -58,11 +59,12 @@ public interface StoreApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -77,13 +79,13 @@ public interface StoreApi { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId); @@ -96,12 +98,12 @@ public interface StoreApi { * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body); 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 6467a130507d..248dafb61359 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -41,11 +42,11 @@ public interface UserApi { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body); @@ -56,11 +57,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -71,11 +72,11 @@ public interface UserApi { * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body); @@ -88,12 +89,12 @@ public interface UserApi { * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username); @@ -106,13 +107,13 @@ public interface UserApi { * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username); @@ -126,12 +127,12 @@ public interface UserApi { * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password); @@ -142,11 +143,11 @@ public interface UserApi { * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -160,12 +161,12 @@ public interface UserApi { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body); 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 f041f733b092..d0964bbc8a57 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,10 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/another-fake/dummy", 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 d50cde96207e..7e671a16c091 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -58,11 +59,10 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/create_xml_item", @@ -81,11 +81,10 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/boolean", @@ -104,11 +103,10 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/composite", @@ -136,11 +134,10 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/number", @@ -159,11 +156,10 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/outer/string", @@ -182,11 +178,10 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/body-with-file-schema", @@ -205,11 +200,10 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/body-with-query-params", @@ -228,11 +222,10 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake", @@ -275,12 +268,12 @@ default ResponseEntity testClientModel(@Parameter(description = "client * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake", @@ -305,12 +298,11 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - } @ApiImplicitParams({ @ApiImplicitParam(name = "enumHeaderStringArray", value = "Header parameter enum test (string array)", dataType = "List", paramType = "header"), @ApiImplicitParam(name = "enumHeaderString", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") @@ -334,11 +326,10 @@ default ResponseEntity testEnumParameters(@Parameter(schema = @Schema(allo * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - } @ApiImplicitParams({ @ApiImplicitParam(name = "requiredBooleanGroup", value = "Required Boolean in group parameters", required=true, dataType = "Boolean", paramType = "header"), @ApiImplicitParam(name = "booleanGroup", value = "Boolean in group parameters", dataType = "Boolean", paramType = "header") @@ -357,11 +348,10 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/inline-additionalProperties", @@ -380,11 +370,10 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/jsonFormData", @@ -407,11 +396,10 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/test-query-paramters", @@ -430,11 +418,14 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", 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 2d7069593024..dc77636fed44 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,11 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/fake_classname_test", 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 0f27c5bbff94..17114ca3eadc 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,15 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet", @@ -74,12 +78,15 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - } @ApiImplicitParams({ @ApiImplicitParam(name = "apiKey", value = "", dataType = "String", paramType = "header") }) @@ -99,12 +106,15 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/findByStatus", @@ -139,12 +149,15 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/findByTags", @@ -179,13 +192,13 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}", @@ -220,14 +233,17 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet", @@ -247,11 +263,14 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}", @@ -271,11 +290,14 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/pet/{petId}/uploadImage", 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 14f55d589b39..aa0ce91e6152 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,11 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order/{order_id}", @@ -72,11 +72,11 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/store/inventory", @@ -97,13 +97,12 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order/{order_id}", @@ -136,12 +135,11 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/store/order", 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 b9f90dd548b8..658cda0eaeef 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,10 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user", @@ -70,11 +70,10 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/createWithArray", @@ -91,11 +90,10 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/createWithList", @@ -114,12 +112,11 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", @@ -138,13 +135,12 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", @@ -178,12 +174,11 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/login", @@ -200,11 +195,10 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/logout", @@ -224,12 +218,11 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - } @ApiImplicitParams({ }) @RequestMapping(value = "/user/{username}", 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 b9a0c1cad2e1..480be87d8017 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -47,11 +48,11 @@ default AnotherFakeApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 098653b87260..da72a9755896 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -57,11 +58,11 @@ default FakeApiDelegate getDelegate() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default Mono> createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody Mono xmlItem, ServerWebExchange exchange) { @@ -76,11 +77,11 @@ default Mono> createXmlItem(@Parameter(description = "XmlIt * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default Mono> fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { @@ -95,11 +96,11 @@ default Mono> fakeOuterBooleanSerialize(@Parameter(descr * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default Mono> fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { @@ -114,11 +115,11 @@ default Mono> fakeOuterCompositeSerialize(@Parame * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default Mono> fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { @@ -133,11 +134,11 @@ default Mono> fakeOuterNumberSerialize(@Parameter(des * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default Mono> fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { @@ -152,11 +153,11 @@ default Mono> fakeOuterStringSerialize(@Parameter(descrip * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default Mono> testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { @@ -171,11 +172,11 @@ default Mono> testBodyWithFileSchema(@Parameter(description * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default Mono> testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { @@ -190,11 +191,11 @@ default Mono> testBodyWithQueryParams(@NotNull @Parameter(s * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -224,12 +225,13 @@ default Mono> testClientModel(@Parameter(description = "c * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default Mono> testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback, ServerWebExchange exchange) { @@ -252,12 +254,12 @@ default Mono> testEndpointParameters(@Parameter(description * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default Mono> testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString, ServerWebExchange exchange) { @@ -277,11 +279,11 @@ default Mono> testEnumParameters(@Parameter(in = ParameterI * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default Mono> testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); @@ -294,11 +296,11 @@ default Mono> testGroupParameters(@NotNull @Parameter(schem * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default Mono> testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Mono param, ServerWebExchange exchange) { @@ -313,11 +315,11 @@ default Mono> testInlineAdditionalProperties(@Parameter(des * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default Mono> testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2, ServerWebExchange exchange) { @@ -336,11 +338,11 @@ default Mono> testJsonFormData(@Parameter(description = "fi * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default Mono> testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context, ServerWebExchange exchange) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); @@ -355,11 +357,15 @@ default Mono> testQueryParameterCollectionFormat(@NotNull @ * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 562a133663af..69171f3987a6 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -47,11 +48,12 @@ default FakeClassnameTestApiDelegate getDelegate() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 9501686f8d28..8bab65bc0231 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -49,12 +50,16 @@ default PetApiDelegate getDelegate() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default Mono> addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { @@ -70,12 +75,16 @@ default Mono> addPet(@Parameter(description = "Pet object t * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default Mono> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey, ServerWebExchange exchange) { return getDelegate().deletePet(petId, apiKey, exchange); @@ -90,12 +99,16 @@ default Mono> deletePet(@Parameter(in = ParameterIn.PATH,de * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono>> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status, ServerWebExchange exchange) { @@ -112,12 +125,16 @@ default Mono>> findPetsByStatus(@NotNull @Parameter(sch * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono>> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags, ServerWebExchange exchange) { @@ -134,13 +151,14 @@ default Mono>> findPetsByTags(@NotNull @Parameter(schem * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono> getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId, ServerWebExchange exchange) { @@ -157,14 +175,18 @@ default Mono> getPetById(@Parameter(in = ParameterIn.PATH,de * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default Mono> updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { @@ -180,11 +202,15 @@ default Mono> updatePet(@Parameter(description = "Pet objec * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default Mono> updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status, ServerWebExchange exchange) { @@ -200,11 +226,15 @@ default Mono> updatePetWithForm(@Parameter(in = ParameterIn * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 c623a4ef068b..c1c9d8aeb6d3 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -49,12 +50,12 @@ default StoreApiDelegate getDelegate() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default Mono> deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId, ServerWebExchange exchange) { return getDelegate().deleteOrder(orderId, exchange); @@ -67,11 +68,12 @@ default Mono> deleteOrder(@Parameter(in = ParameterIn.PATH, * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default Mono>> getInventory(ServerWebExchange exchange) { @@ -88,13 +90,13 @@ default Mono>> getInventory(ServerWebExchang * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono> getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId, ServerWebExchange exchange) { @@ -109,12 +111,12 @@ default Mono> getOrderById(@Min(1L) @Max(5L) @Parameter(in * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default Mono> placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { 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 e0987032c604..516f3c5b30a0 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -48,11 +49,11 @@ default UserApiDelegate getDelegate() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default Mono> createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().createUser(body, exchange); @@ -65,11 +66,11 @@ default Mono> createUser(@Parameter(description = "Created * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default Mono> createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { return getDelegate().createUsersWithArrayInput(body, exchange); @@ -82,11 +83,11 @@ default Mono> createUsersWithArrayInput(@Parameter(descript * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default Mono> createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { return getDelegate().createUsersWithListInput(body, exchange); @@ -101,12 +102,12 @@ default Mono> createUsersWithListInput(@Parameter(descripti * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default Mono> deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username, ServerWebExchange exchange) { return getDelegate().deleteUser(username, exchange); @@ -121,13 +122,13 @@ default Mono> deleteUser(@Parameter(in = ParameterIn.PATH,d * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono> getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username, ServerWebExchange exchange) { @@ -143,12 +144,12 @@ default Mono> getUserByName(@Parameter(in = ParameterIn.PAT * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default Mono> loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password, ServerWebExchange exchange) { @@ -161,11 +162,11 @@ default Mono> loginUser(@NotNull @Parameter(schema = @Sch * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default Mono> logoutUser(ServerWebExchange exchange) { return getDelegate().logoutUser(exchange); @@ -181,12 +182,12 @@ default Mono> logoutUser(ServerWebExchange exchange) { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default Mono> updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { return getDelegate().updateUser(username, body, exchange); 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 65f4740bc51c..1751b2166d6e 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,11 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 7dc7363abda5..36853da522e3 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -58,11 +59,11 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -78,11 +79,11 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -98,11 +99,11 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -127,11 +128,11 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -147,11 +148,11 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -167,11 +168,11 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -187,11 +188,11 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -207,11 +208,11 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -251,12 +252,13 @@ default ResponseEntity testClientModel(@Parameter(description = "client * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -280,12 +282,12 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) Optional> enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) Optional enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") Optional enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -306,11 +308,11 @@ default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEAD * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Optional booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -324,11 +326,11 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -344,11 +346,11 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -368,11 +370,11 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -388,11 +390,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 d5e698d2b779..1e14807b5384 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,12 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 8b44dcc8d091..67bfc4a7016d 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,16 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -72,12 +77,16 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) Optional apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -93,12 +102,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -130,12 +143,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -167,13 +184,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -205,14 +223,18 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -229,11 +251,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -250,11 +276,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 7049253cccb1..152d75fd68e4 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,12 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -69,11 +70,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -91,13 +93,13 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -127,12 +129,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { 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 0b8acf16d830..5df1285ff344 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,11 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -67,11 +68,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,11 +86,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -105,12 +106,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,13 +127,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -163,12 +164,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -182,11 +183,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -203,12 +204,12 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 029e5ad4e7db..1b1f7cb11a30 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -52,11 +53,11 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 5ba39068e346..94f300aad55d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -62,11 +63,11 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -83,11 +84,11 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @return Output boolean (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -104,11 +105,11 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @return Output composite (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -134,11 +135,11 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @return Output number (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -155,11 +156,11 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @return Output string (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -176,11 +177,11 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @return Success (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -197,11 +198,11 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @return Success (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -218,11 +219,11 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -263,12 +264,13 @@ default ResponseEntity testClientModel(@Parameter(description = "client * or User not found (status code 404) */ @ApiVirtual - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -293,12 +295,12 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * or Not found (status code 404) */ @ApiVirtual - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -320,11 +322,11 @@ default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEAD * @return Someting wrong (status code 400) */ @ApiVirtual - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -339,11 +341,11 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -360,11 +362,11 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -385,11 +387,11 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @return Success (status code 200) */ @ApiVirtual - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -406,11 +408,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 8417ecdfabc4..468ef6555258 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -52,11 +53,12 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 49f15da5cd7c..e04175fc5a3a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -54,12 +55,16 @@ default Optional getRequest() { * or Invalid input (status code 405) */ @ApiVirtual - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -77,12 +82,16 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * or Invalid pet value (status code 400) */ @ApiVirtual - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -99,12 +108,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * or Invalid status value (status code 400) */ @ApiVirtual - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -137,12 +150,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * @deprecated */ @ApiVirtual - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -175,13 +192,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Pet not found (status code 404) */ @ApiVirtual - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -214,14 +232,18 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Validation exception (status code 405) */ @ApiVirtual - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -239,11 +261,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @return Invalid input (status code 405) */ @ApiVirtual - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -261,11 +287,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 4424a1ae382a..abe38fb191f7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -54,12 +55,12 @@ default Optional getRequest() { * or Order not found (status code 404) */ @ApiVirtual - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -74,11 +75,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -97,13 +99,13 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) */ @ApiVirtual - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -134,12 +136,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * or Invalid Order (status code 400) */ @ApiVirtual - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 2346b7aa4a0b..a55a40072cf9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -53,11 +54,11 @@ default Optional getRequest() { * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -72,11 +73,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -91,11 +92,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -112,12 +113,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * or User not found (status code 404) */ @ApiVirtual - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -134,13 +135,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or User not found (status code 404) */ @ApiVirtual - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -172,12 +173,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * or Invalid username/password supplied (status code 400) */ @ApiVirtual - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -192,11 +193,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * @return successful operation (status code 200) */ @ApiVirtual - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,12 +215,12 @@ default ResponseEntity logoutUser() { * or User not found (status code 404) */ @ApiVirtual - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); 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 65f4740bc51c..1751b2166d6e 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,11 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test special tags", description = "To test special tags and operation ID starting with number", + @Operation(summary = "To test special tags", operationId = "call123testSpecialTags", description = "To test special tags and operation ID starting with number", tags={ "$another-fake?", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/another-fake/dummy", + @RequestMapping(value = "/another-fake/dummy", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 c8ea7c803760..3cf5b6839ead 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 @@ -21,6 +21,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -58,11 +59,11 @@ default Optional getRequest() { * @param xmlItem XmlItem Body (required) * @return successful operation (status code 200) */ - @Operation(summary = "creates an XmlItem", description = "this route creates an XmlItem", + @Operation(summary = "creates an XmlItem", operationId = "createXmlItem", description = "this route creates an XmlItem", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/create_xml_item", + @RequestMapping(value = "/fake/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" }, method = RequestMethod.POST) default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Body" ,required=true ) @Valid @RequestBody XmlItem xmlItem) { @@ -78,11 +79,11 @@ default ResponseEntity createXmlItem(@Parameter(description = "XmlItem Bod * @param body Input boolean as post body (optional) * @return Output boolean (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer boolean types", + @Operation(summary = "", operationId = "fakeOuterBooleanSerialize", description = "Test serialization of outer boolean types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output boolean" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Boolean.class)) )} ) }) - @RequestMapping(value = "/fake/outer/boolean", + @RequestMapping(value = "/fake/outer/boolean", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) { @@ -98,11 +99,11 @@ default ResponseEntity fakeOuterBooleanSerialize(@Parameter(description * @param body Input composite as post body (optional) * @return Output composite (status code 200) */ - @Operation(summary = "", description = "Test serialization of object with outer number type", + @Operation(summary = "", operationId = "fakeOuterCompositeSerialize", description = "Test serialization of object with outer number type", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output composite" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = OuterComposite.class)) )} ) }) - @RequestMapping(value = "/fake/outer/composite", + @RequestMapping(value = "/fake/outer/composite", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterCompositeSerialize(@Parameter(description = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) { @@ -127,11 +128,11 @@ default ResponseEntity fakeOuterCompositeSerialize(@Parameter(de * @param body Input number as post body (optional) * @return Output number (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer number types", + @Operation(summary = "", operationId = "fakeOuterNumberSerialize", description = "Test serialization of outer number types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output number" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = BigDecimal.class)) )} ) }) - @RequestMapping(value = "/fake/outer/number", + @RequestMapping(value = "/fake/outer/number", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterNumberSerialize(@Parameter(description = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) { @@ -147,11 +148,11 @@ default ResponseEntity fakeOuterNumberSerialize(@Parameter(descripti * @param body Input string as post body (optional) * @return Output string (status code 200) */ - @Operation(summary = "", description = "Test serialization of outer string types", + @Operation(summary = "", operationId = "fakeOuterStringSerialize", description = "Test serialization of outer string types", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Output string" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) }) - @RequestMapping(value = "/fake/outer/string", + @RequestMapping(value = "/fake/outer/string", produces = { "*/*" }, method = RequestMethod.POST) default ResponseEntity fakeOuterStringSerialize(@Parameter(description = "Input string as post body" ) @Valid @RequestBody(required = false) String body) { @@ -167,11 +168,11 @@ default ResponseEntity fakeOuterStringSerialize(@Parameter(description = * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "For this test, the body for this request much reference a schema named `File`.", + @Operation(summary = "", operationId = "testBodyWithFileSchema", description = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-file-schema", + @RequestMapping(value = "/fake/body-with-file-schema", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass body) { @@ -187,11 +188,11 @@ default ResponseEntity testBodyWithFileSchema(@Parameter(description = "" * @param body (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "", + @Operation(summary = "", operationId = "testBodyWithQueryParams", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/body-with-query-params", + @RequestMapping(value = "/fake/body-with-query-params", consumes = { "application/json" }, method = RequestMethod.PUT) default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "query", required = true) String query,@Parameter(description = "" ,required=true ) @Valid @RequestBody User body) { @@ -207,11 +208,11 @@ default ResponseEntity testBodyWithQueryParams(@NotNull @Parameter(schema * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test \"client\" model", description = "To test \"client\" model", + @Operation(summary = "To test \"client\" model", operationId = "testClientModel", description = "To test \"client\" model", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) @@ -251,12 +252,13 @@ default ResponseEntity testClientModel(@Parameter(description = "client * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", + @Operation(summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", operationId = "testEndpointParameters", description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", tags={ "fake", }, + security = @SecurityRequirement(name = "http_basic_test"), responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity testEndpointParameters(@Parameter(description = "None",required=true) @RequestPart(value="number", required=true) BigDecimal number,@Parameter(description = "None",required=true) @RequestPart(value="double", required=true) Double _double,@Parameter(description = "None",required=true) @RequestPart(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@Parameter(description = "None",required=true) @RequestPart(value="byte", required=true) byte[] _byte,@Parameter(description = "None") @RequestPart(value="integer", required=false) Integer integer,@Parameter(description = "None") @RequestPart(value="int32", required=false) Integer int32,@Parameter(description = "None") @RequestPart(value="int64", required=false) Long int64,@Parameter(description = "None") @RequestPart(value="float", required=false) Float _float,@Parameter(description = "None") @RequestPart(value="string", required=false) String string,@Parameter(description = "None") @Valid @RequestPart(value = "binary") MultipartFile binary,@Parameter(description = "None") @RequestPart(value="date", required=false) LocalDate date,@Parameter(description = "None") @RequestPart(value="dateTime", required=false) OffsetDateTime dateTime,@Parameter(description = "None") @RequestPart(value="password", required=false) String password,@Parameter(description = "None") @RequestPart(value="callback", required=false) String paramCallback) { @@ -280,12 +282,12 @@ default ResponseEntity testEndpointParameters(@Parameter(description = "No * @return Invalid request (status code 400) * or Not found (status code 404) */ - @Operation(summary = "To test enum parameters", description = "To test enum parameters", + @Operation(summary = "To test enum parameters", operationId = "testEnumParameters", description = "To test enum parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid request" ) , @ApiResponse(responseCode = "404", description = "Not found" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string array)" , schema = @Schema(allowableValues={">, $"})) @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@Parameter(in = ParameterIn.HEADER, description = "Header parameter enum test (string)" , schema = @Schema(allowableValues={"_abc, -efg, (xyz)"}, example="-efg")) @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@Parameter(schema = @Schema(allowableValues = {">, $"}, description = "Query parameter enum test (string array)")) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@Parameter(schema = @Schema(allowableValues = {"_abc, -efg, (xyz)"}, description = "Query parameter enum test (string)", example = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue="-efg") String enumQueryString,@Parameter(schema = @Schema(allowableValues = {"1, -2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,@Parameter(schema = @Schema(allowableValues = {"1.1, -1.2"}, description = "Query parameter enum test (double)")) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@Parameter(description = "Form parameter enum test (string array)",schema = @Schema(allowableValues ={">, $"})) @RequestPart(value="enum_form_string_array", required=false) List enumFormStringArray,@Parameter(description = "Form parameter enum test (string)",schema = @Schema(allowableValues ={"_abc, -efg, (xyz)"}), example="-efg") @RequestPart(value="enum_form_string", required=false) String enumFormString) { @@ -306,11 +308,11 @@ default ResponseEntity testEnumParameters(@Parameter(in = ParameterIn.HEAD * @param int64Group Integer in group parameters (optional) * @return Someting wrong (status code 400) */ - @Operation(summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)", + @Operation(summary = "Fake endpoint to test group parameters (optional)", operationId = "testGroupParameters", description = "Fake endpoint to test group parameters (optional)", tags={ "fake", }, responses = { @ApiResponse(responseCode = "400", description = "Someting wrong" ) }) - @RequestMapping(value = "/fake", + @RequestMapping(value = "/fake", method = RequestMethod.DELETE) default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @Schema( description = "Required String in group parameters", required = true)) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@Parameter(in = ParameterIn.HEADER, description = "Required Boolean in group parameters" ,required=true ) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @Parameter(schema = @Schema( description = "Required Integer in group parameters", required = true)) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@Parameter(schema = @Schema( description = "String in group parameters")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@Parameter(in = ParameterIn.HEADER, description = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@Parameter(schema = @Schema( description = "Integer in group parameters")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -324,11 +326,11 @@ default ResponseEntity testGroupParameters(@NotNull @Parameter(schema = @S * @param param request body (required) * @return successful operation (status code 200) */ - @Operation(summary = "test inline additionalProperties", description = "", + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/inline-additionalProperties", + @RequestMapping(value = "/fake/inline-additionalProperties", consumes = { "application/json" }, method = RequestMethod.POST) default ResponseEntity testInlineAdditionalProperties(@Parameter(description = "request body" ,required=true ) @Valid @RequestBody Map param) { @@ -344,11 +346,11 @@ default ResponseEntity testInlineAdditionalProperties(@Parameter(descripti * @param param2 field2 (required) * @return successful operation (status code 200) */ - @Operation(summary = "test json serialization of form data", description = "", + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", description = "", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/fake/jsonFormData", + @RequestMapping(value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.GET) default ResponseEntity testJsonFormData(@Parameter(description = "field1",required=true) @RequestPart(value="param", required=true) String param,@Parameter(description = "field2",required=true) @RequestPart(value="param2", required=true) String param2) { @@ -368,11 +370,11 @@ default ResponseEntity testJsonFormData(@Parameter(description = "field1", * @param context (required) * @return Success (status code 200) */ - @Operation(summary = "", description = "To test the collection format in query parameters", + @Operation(summary = "", operationId = "testQueryParameterCollectionFormat", description = "To test the collection format in query parameters", tags={ "fake", }, responses = { @ApiResponse(responseCode = "200", description = "Success" ) }) - @RequestMapping(value = "/fake/test-query-paramters", + @RequestMapping(value = "/fake/test-query-paramters", method = RequestMethod.PUT) default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @Parameter(schema = @Schema( description = "", required = true)) @Valid @RequestParam(value = "context", required = true) List context) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -388,11 +390,15 @@ default ResponseEntity testQueryParameterCollectionFormat(@NotNull @Parame * @param additionalMetadata Additional data to pass to server (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image (required)", description = "", + @Operation(summary = "uploads an image (required)", operationId = "uploadFileWithRequiredFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", + @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 d5e698d2b779..1e14807b5384 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 @@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -48,11 +49,12 @@ default Optional getRequest() { * @param body client model (required) * @return successful operation (status code 200) */ - @Operation(summary = "To test class name in snake case", description = "To test class name in snake case", + @Operation(summary = "To test class name in snake case", operationId = "testClassname", description = "To test class name in snake case", tags={ "fake_classname_tags 123#$%^", }, + security = @SecurityRequirement(name = "api_key_query"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Client.class)) )} ) }) - @RequestMapping(value = "/fake_classname_test", + @RequestMapping(value = "/fake_classname_test", produces = { "application/json" }, consumes = { "application/json" }, method = RequestMethod.PATCH) 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 6d281fbede4e..0fe77c699c0c 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 @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,16 @@ default Optional getRequest() { * @return successful operation (status code 200) * or Invalid input (status code 405) */ - @Operation(summary = "Add a new pet to the store", description = "", + @Operation(summary = "Add a new pet to the store", operationId = "addPet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) default ResponseEntity addPet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -72,12 +77,16 @@ default ResponseEntity addPet(@Parameter(description = "Pet object that ne * @return successful operation (status code 200) * or Invalid pet value (status code 400) */ - @Operation(summary = "Deletes a pet", description = "", + @Operation(summary = "Deletes a pet", operationId = "deletePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) , @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -93,12 +102,16 @@ default ResponseEntity deletePet(@Parameter(in = ParameterIn.PATH,descript * @return successful operation (status code 200) * or Invalid status value (status code 400) */ - @Operation(summary = "Finds Pets by status", description = "Multiple status values can be provided with comma separated strings", + @Operation(summary = "Finds Pets by status", operationId = "findPetsByStatus", description = "Multiple status values can be provided with comma separated strings", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) - @RequestMapping(value = "/pet/findByStatus", + @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = @Schema(allowableValues = {"available, pending, sold"}, description = "Status values that need to be considered for filter", required = true)) @Valid @RequestParam(value = "status", required = true) List status) { @@ -130,12 +143,16 @@ default ResponseEntity> findPetsByStatus(@NotNull @Parameter(schema = * or Invalid tag value (status code 400) * @deprecated */ - @Operation(summary = "Finds Pets by tags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + @Operation(summary = "Finds Pets by tags", operationId = "findPetsByTags", description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) - @RequestMapping(value = "/pet/findByTags", + @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @Schema( description = "Tags to filter by", required = true)) @Valid @RequestParam(value = "tags", required = true) List tags) { @@ -167,13 +184,14 @@ default ResponseEntity> findPetsByTags(@NotNull @Parameter(schema = @S * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) */ - @Operation(summary = "Find pet by ID", description = "Returns a single pet", + @Operation(summary = "Find pet by ID", operationId = "getPetById", description = "Returns a single pet", tags={ "pet", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Pet not found" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,description = "ID of pet to return", required=true) @PathVariable("petId") Long petId) { @@ -205,14 +223,18 @@ default ResponseEntity getPetById(@Parameter(in = ParameterIn.PATH,descript * or Pet not found (status code 404) * or Validation exception (status code 405) */ - @Operation(summary = "Update an existing pet", description = "", + @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read: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" ) }) - @RequestMapping(value = "/pet", + @RequestMapping(value = "/pet", consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) default ResponseEntity updatePet(@Parameter(description = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet body) { @@ -229,11 +251,15 @@ default ResponseEntity updatePet(@Parameter(description = "Pet object that * @param status Updated status of the pet (optional) * @return Invalid input (status code 405) */ - @Operation(summary = "Updates a pet in the store with form data", description = "", + @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) - @RequestMapping(value = "/pet/{petId}", + @RequestMapping(value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be updated", required=true) @PathVariable("petId") Long petId,@Parameter(description = "Updated name of the pet") @RequestPart(value="name", required=false) String name,@Parameter(description = "Updated status of the pet") @RequestPart(value="status", required=false) String status) { @@ -250,11 +276,15 @@ default ResponseEntity updatePetWithForm(@Parameter(in = ParameterIn.PATH, * @param file file to upload (optional) * @return successful operation (status code 200) */ - @Operation(summary = "uploads an image", description = "", + @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, + security = @SecurityRequirement(name = "petstore_auth", scopes = { + "write:pets" , + "read:pets" + }), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) - @RequestMapping(value = "/pet/{petId}/uploadImage", + @RequestMapping(value = "/pet/{petId}/uploadImage", produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) 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 7049253cccb1..152d75fd68e4 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -50,12 +51,12 @@ default Optional getRequest() { * @return Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(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", + @Operation(summary = "Delete purchase order by ID", operationId = "deleteOrder", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", tags={ "store", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", method = RequestMethod.DELETE) default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,description = "ID of the order that needs to be deleted", required=true) @PathVariable("order_id") String orderId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -69,11 +70,12 @@ default ResponseEntity deleteOrder(@Parameter(in = ParameterIn.PATH,descri * * @return successful operation (status code 200) */ - @Operation(summary = "Returns pet inventories by status", description = "Returns a map of status codes to quantities", + @Operation(summary = "Returns pet inventories by status", operationId = "getInventory", description = "Returns a map of status codes to quantities", tags={ "store", }, + security = @SecurityRequirement(name = "api_key"), responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Map.class) )} ) }) - @RequestMapping(value = "/store/inventory", + @RequestMapping(value = "/store/inventory", produces = { "application/json" }, method = RequestMethod.GET) default ResponseEntity> getInventory() { @@ -91,13 +93,13 @@ default ResponseEntity> getInventory() { * or Invalid ID supplied (status code 400) * or Order not found (status code 404) */ - @Operation(summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + @Operation(summary = "Find purchase order by ID", operationId = "getOrderById", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , @ApiResponse(responseCode = "404", description = "Order not found" ) }) - @RequestMapping(value = "/store/order/{order_id}", + @RequestMapping(value = "/store/order/{order_id}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = ParameterIn.PATH,description = "ID of pet that needs to be fetched", required=true) @PathVariable("order_id") Long orderId) { @@ -127,12 +129,12 @@ default ResponseEntity getOrderById(@Min(1L) @Max(5L) @Parameter(in = Par * @return successful operation (status code 200) * or Invalid Order (status code 400) */ - @Operation(summary = "Place an order for a pet", description = "", + @Operation(summary = "Place an order for a pet", operationId = "placeOrder", description = "", tags={ "store", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Order.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid Order" ) }) - @RequestMapping(value = "/store/order", + @RequestMapping(value = "/store/order", produces = { "application/xml", "application/json" }, method = RequestMethod.POST) default ResponseEntity placeOrder(@Parameter(description = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Order body) { 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 0b8acf16d830..5df1285ff344 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 @@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.media.*; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -49,11 +50,11 @@ default Optional getRequest() { * @param body Created user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Create user", description = "This can only be done by the logged in user.", + @Operation(summary = "Create user", operationId = "createUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user", + @RequestMapping(value = "/user", method = RequestMethod.POST) default ResponseEntity createUser(@Parameter(description = "Created user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -67,11 +68,11 @@ default ResponseEntity createUser(@Parameter(description = "Created user o * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithArrayInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithArray", + @RequestMapping(value = "/user/createWithArray", method = RequestMethod.POST) default ResponseEntity createUsersWithArrayInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -85,11 +86,11 @@ default ResponseEntity createUsersWithArrayInput(@Parameter(description = * @param body List of user object (required) * @return successful operation (status code 200) */ - @Operation(summary = "Creates list of users with given input array", description = "", + @Operation(summary = "Creates list of users with given input array", operationId = "createUsersWithListInput", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/createWithList", + @RequestMapping(value = "/user/createWithList", method = RequestMethod.POST) default ResponseEntity createUsersWithListInput(@Parameter(description = "List of user object" ,required=true ) @Valid @RequestBody List body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -105,12 +106,12 @@ default ResponseEntity createUsersWithListInput(@Parameter(description = " * @return Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Delete user", description = "This can only be done by the logged in user.", + @Operation(summary = "Delete user", operationId = "deleteUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.DELETE) default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be deleted", required=true) @PathVariable("username") String username) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -126,13 +127,13 @@ default ResponseEntity deleteUser(@Parameter(in = ParameterIn.PATH,descrip * or Invalid username supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Get user by user name", description = "", + @Operation(summary = "Get user by user name", operationId = "getUserByName", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = User.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,description = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") String username) { @@ -163,12 +164,12 @@ default ResponseEntity getUserByName(@Parameter(in = ParameterIn.PATH,desc * @return successful operation (status code 200) * or Invalid username/password supplied (status code 400) */ - @Operation(summary = "Logs user into the system", description = "", + @Operation(summary = "Logs user into the system", operationId = "loginUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = String.class)) )} ) , @ApiResponse(responseCode = "400", description = "Invalid username/password supplied" ) }) - @RequestMapping(value = "/user/login", + @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( description = "The user name for login", required = true)) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @Parameter(schema = @Schema( description = "The password for login in clear text", required = true)) @Valid @RequestParam(value = "password", required = true) String password) { @@ -182,11 +183,11 @@ default ResponseEntity loginUser(@NotNull @Parameter(schema = @Schema( d * * @return successful operation (status code 200) */ - @Operation(summary = "Logs out current logged in user session", description = "", + @Operation(summary = "Logs out current logged in user session", operationId = "logoutUser", description = "", tags={ "user", }, responses = { @ApiResponse(responseCode = "200", description = "successful operation" ) }) - @RequestMapping(value = "/user/logout", + @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -203,12 +204,12 @@ default ResponseEntity logoutUser() { * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ - @Operation(summary = "Updated user", description = "This can only be done by the logged in user.", + @Operation(summary = "Updated user", operationId = "updateUser", description = "This can only be done by the logged in user.", tags={ "user", }, responses = { @ApiResponse(responseCode = "400", description = "Invalid user supplied" ) , @ApiResponse(responseCode = "404", description = "User not found" ) }) - @RequestMapping(value = "/user/{username}", + @RequestMapping(value = "/user/{username}", method = RequestMethod.PUT) default ResponseEntity updateUser(@Parameter(in = ParameterIn.PATH,description = "name that need to be deleted", required=true) @PathVariable("username") String username,@Parameter(description = "Updated user object" ,required=true ) @Valid @RequestBody User body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); From 04d12fa14b3f99a62b7105cf35d3cb87c47659d0 Mon Sep 17 00:00:00 2001 From: Alexej Date: Sat, 8 Aug 2020 14:16:55 +0200 Subject: [PATCH 5/5] Fix OpenAPITools#5556 fixed alignment to 4 spaces --- .../libraries/spring-boot/pom.mustache | 6 +-- .../libraries/spring-mvc/pom.mustache | 8 ++-- .../java/org/openapitools/api/PetApi.java | 44 +++++++++---------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index fb672e32205c..5de80cffd42a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -96,9 +96,9 @@ ${springfox-version} - io.swagger.core.v3 - swagger-annotations - ${swagger-annotations-version} + io.swagger.core.v3 + swagger-annotations + ${swagger-annotations-version} javax.xml.bind diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 69e8c02e88b3..26c51f1d26e0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -166,9 +166,9 @@ ${springfox-version} - io.swagger.core.v3 - swagger-annotations - 2.1.1 + io.swagger.core.v3 + swagger-annotations + 2.1.1 {{/useSpringfox}} {{^useSpringfox}} @@ -178,7 +178,7 @@ 3.14.2 - io.swagger.core.v3 + io.swagger.core.v3 swagger-annotations 2.1.1 diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 15631f88abb7..38791342d099 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -51,10 +51,10 @@ public interface PetApi { tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets" , - "read:pets" + "read:pets" }), responses = { - @ApiResponse(responseCode = "405", description = "Invalid input" ) }) + @ApiResponse(responseCode = "405", description = "Invalid input") }) @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.POST) @@ -72,10 +72,10 @@ public interface PetApi { tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets" , - "read:pets" + "read:pets" }), responses = { - @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) + @ApiResponse(responseCode = "400", description = "Invalid pet value" ) }) @RequestMapping(value = "/pet/{petId}", method = RequestMethod.DELETE) CompletableFuture> deletePet(@Parameter(in = ParameterIn.PATH,description = "Pet id to delete", required=true) @PathVariable("petId") Long petId,@Parameter(in = ParameterIn.HEADER, description = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -93,11 +93,11 @@ public interface PetApi { tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { "write:pets" , - "read:pets" + "read:pets" }), responses = { - @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , - @ApiResponse(responseCode = "400", description = "Invalid status value" ) }) + @ApiResponse(responseCode = "200", description = "successful operation", content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid status value") }) @RequestMapping(value = "/pet/findByStatus", produces = "application/json", method = RequestMethod.GET) @@ -120,8 +120,8 @@ public interface PetApi { "read:pets" }), responses = { - @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , - @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( schema = @Schema(implementation = Pet.class) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid tag value" ) }) @RequestMapping(value = "/pet/findByTags", produces = "application/json", method = RequestMethod.GET) @@ -141,9 +141,9 @@ public interface PetApi { tags={ "pet", }, security = @SecurityRequirement(name = "api_key"), responses = { - @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , - @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , - @ApiResponse(responseCode = "404", description = "Pet not found" ) }) + @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = Pet.class)) )} ) , + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) }) @RequestMapping(value = "/pet/{petId}", produces = "application/json", method = RequestMethod.GET) @@ -161,13 +161,13 @@ public interface PetApi { @Operation(summary = "Update an existing pet", operationId = "updatePet", description = "", tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { - "write:pets" , - "read:pets" + "write:pets", + "read:pets" }), responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , - @ApiResponse(responseCode = "404", description = "Pet not found" ) , - @ApiResponse(responseCode = "405", description = "Validation exception" ) }) + @ApiResponse(responseCode = "400", description = "Invalid ID supplied" ) , + @ApiResponse(responseCode = "404", description = "Pet not found" ) , + @ApiResponse(responseCode = "405", description = "Validation exception" ) }) @RequestMapping(value = "/pet", consumes = "application/json", method = RequestMethod.PUT) @@ -185,8 +185,8 @@ public interface PetApi { @Operation(summary = "Updates a pet in the store with form data", operationId = "updatePetWithForm", description = "", tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { - "write:pets" , - "read:pets" + "write:pets", + "read:pets" }), responses = { @ApiResponse(responseCode = "405", description = "Invalid input" ) }) @@ -207,11 +207,11 @@ public interface PetApi { @Operation(summary = "uploads an image", operationId = "uploadFile", description = "", tags={ "pet", }, security = @SecurityRequirement(name = "petstore_auth", scopes = { - "write:pets" , - "read:pets" + "write:pets", + "read:pets" }), responses = { - @ApiResponse(responseCode = "200", description = "successful operation" , content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) + @ApiResponse(responseCode = "200", description = "successful operation", content = { @Content( array = @ArraySchema(schema = @Schema(implementation = ModelApiResponse.class)) )} ) }) @RequestMapping(value = "/pet/{petId}/uploadImage", produces = "application/json", consumes = "multipart/form-data",