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..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 @@ -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 and io.swagger.annotations.ApiModelProperty imports + 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..1daf379aa2d0 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; {{#jdk8-no-delegate}} {{#virtualService}} import io.virtualan.annotation.ApiVirtual; @@ -61,7 +67,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,15 +113,17 @@ 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}} }) + @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}} @ApiImplicitParams({ {{#headerParams}} 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..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 @@ -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..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 @@ -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 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/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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +38,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 +47,18 @@ 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") }) + @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", 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 +68,17 @@ 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") }) + @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}", 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 +89,19 @@ 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") }) + @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", 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 +113,19 @@ 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") }) + @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", 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 +137,17 @@ 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") }) + @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}", 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 +158,20 @@ 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") }) + @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", 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 +182,18 @@ 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") }) + @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}", 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 +204,18 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +37,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 +48,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") }) + @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}", 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,11 +64,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") }) + @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", produces = "application/json", method = RequestMethod.GET) @@ -77,15 +84,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") }) + @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}", 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 +103,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +37,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 +47,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") }) + @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", 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 +62,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") }) + @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", 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 +77,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") }) + @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", 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 +94,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") }) + @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}", 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 +112,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") }) + @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}", 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 +132,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") }) + @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", 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,9 +148,10 @@ 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") }) + @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", method = RequestMethod.GET) CompletableFuture> logoutUser(); @@ -153,12 +166,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") }) + @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}", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +46,18 @@ 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") }) + @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", 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 +67,17 @@ 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") }) + @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}", 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 +88,19 @@ 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") }) + @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", 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 +112,19 @@ 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") }) + @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", 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 +136,17 @@ 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") }) + @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}", 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 +157,20 @@ 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") }) + @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", 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 +181,18 @@ 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") }) + @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}", 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 +203,18 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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}", 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,11 +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") }) + @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", produces = "application/json", method = RequestMethod.GET) @@ -76,15 +83,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") }) + @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}", 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 +102,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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", 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 +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") }) + @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", 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 +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") }) + @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", 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 +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") }) + @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}", 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 +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") }) + @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}", 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 +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") }) + @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", 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,9 +147,10 @@ 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") }) + @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", method = RequestMethod.GET) com.netflix.hystrix.HystrixCommand> logoutUser(); @@ -152,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") }) + @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}", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +50,18 @@ 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") }) + @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", 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 +74,17 @@ 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") }) + @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}", 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 +98,19 @@ 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", 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", 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 +139,19 @@ 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", 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", 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 +180,17 @@ 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", 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}", 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 +218,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 = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") }) + @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", 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 +245,18 @@ 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", 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}", 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 +270,19 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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}", 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,11 +70,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", 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", produces = "application/json", method = RequestMethod.GET) @@ -86,15 +93,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") }) + @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}", 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 +129,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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", 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 +68,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") }) + @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", 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 +86,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") }) + @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", 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 +106,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") }) + @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}", 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 +127,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") }) + @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}", 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 +164,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") }) + @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", 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,9 +183,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -191,13 +204,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +36,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 +50,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +46,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 +60,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") }) + @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", 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 +80,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) }) + @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", 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 +100,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) }) + @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", 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 +131,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) }) + @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", 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 +151,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) }) + @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", 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 +171,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") }) + @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", 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 +191,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +211,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) }) + @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", 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 +257,16 @@ 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") }) + @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", 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 +287,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") }) + @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", 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 +313,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") }) + @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", 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 +331,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +351,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +375,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") }) + @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", 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 +395,19 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +36,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 +50,16 @@ 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", 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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +38,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 +52,19 @@ 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", 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", 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 +78,18 @@ 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") }) + @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}", 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 +103,19 @@ 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") }) + @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", 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 +146,19 @@ 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") }) + @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", 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 +189,17 @@ 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") }) + @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}", 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 +230,21 @@ 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") }) + @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", 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 +258,18 @@ 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") }) + @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}", 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 +283,19 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +37,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 +52,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") }) + @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}", 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,11 +71,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -87,15 +94,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") }) + @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}", 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 +132,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +37,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 +51,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") }) + @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", 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 +69,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") }) + @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", 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 +87,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") }) + @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", 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 +107,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") }) + @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}", 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 +128,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") }) + @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}", 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 +167,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") }) + @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", 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,9 +186,10 @@ 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") }) + @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", method = RequestMethod.GET) default CompletableFuture> logoutUser() { @@ -194,13 +207,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +45,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 +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") }) + @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", 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 +79,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) }) + @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", 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 +99,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) }) + @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", 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 +128,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) }) + @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", 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 +148,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) }) + @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", 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 +168,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") }) + @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", 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 +188,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +208,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) }) + @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", 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 +252,16 @@ 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 假端點 偽のエンドポイント 가짜 엔드 포인트", 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", 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 +282,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") }) + @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", 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 +308,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") }) + @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", 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 +326,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +346,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +370,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") }) + @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", 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 +390,19 @@ 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)", 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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,16 @@ 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", 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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +51,19 @@ 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", 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", 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 +77,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", 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}", 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 +102,19 @@ 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", 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", 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 +143,19 @@ 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", 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", 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 +184,17 @@ 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", 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}", 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 +223,21 @@ 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", 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", 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 +251,18 @@ 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", 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}", 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 +276,19 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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}", 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,11 +70,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", 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", produces = { "application/json" }, method = RequestMethod.GET) @@ -86,15 +93,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") }) + @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}", 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 +129,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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", 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 +68,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") }) + @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", 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 +86,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") }) + @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", 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 +106,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") }) + @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}", 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 +127,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") }) + @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}", 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 +164,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") }) + @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", 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,9 +183,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -191,13 +204,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +41,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 +51,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") }) + @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", 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 +68,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) }) + @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", 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 +85,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) }) + @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", 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 +102,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) }) + @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", 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 +119,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) }) + @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", 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 +136,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") }) + @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", 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 +153,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +170,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) }) + @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", 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 +202,16 @@ 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") }) + @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", 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 +229,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") }) + @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", 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 +252,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") }) + @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", 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 +267,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +284,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +305,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") }) + @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", 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 +322,18 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,15 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +33,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 +43,19 @@ 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") }) + @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", 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 +66,18 @@ 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") }) + @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}", 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 +88,19 @@ 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") }) + @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", 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 +112,19 @@ 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") }) + @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", 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 +136,17 @@ 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") }) + @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}", 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 +158,21 @@ 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") }) + @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", 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 +183,18 @@ 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") }) + @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}", 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 +205,18 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +43,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") }) + @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}", 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,11 +59,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -72,15 +79,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") }) + @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}", 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 +98,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +42,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") }) + @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", 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 +57,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") }) + @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", 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 +72,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") }) + @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", 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 +89,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") }) + @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}", 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 +107,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") }) + @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}", 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 +127,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") }) + @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", 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,9 +143,10 @@ 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") }) + @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", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +161,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +41,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 +51,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") }) + @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", 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 +68,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) }) + @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", 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 +85,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) }) + @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", 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 +102,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) }) + @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", 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 +119,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) }) + @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", 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 +136,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") }) + @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", 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 +153,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +170,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) }) + @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", 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 +202,16 @@ 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") }) + @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", 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 +229,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") }) + @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", 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 +252,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") }) + @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", 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 +267,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +284,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +305,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") }) + @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", 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 +322,18 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,15 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +33,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 +43,19 @@ 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") }) + @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", 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 +66,18 @@ 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") }) + @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}", 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 +88,19 @@ 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") }) + @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", 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 +112,19 @@ 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") }) + @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", 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 +136,17 @@ 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") }) + @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}", 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 +158,21 @@ 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") }) + @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", 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 +183,18 @@ 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") }) + @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}", 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 +205,18 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +43,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") }) + @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}", 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,11 +59,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -72,15 +79,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") }) + @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}", 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 +98,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +42,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") }) + @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", 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 +57,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") }) + @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", 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 +72,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") }) + @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", 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 +89,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") }) + @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}", 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 +107,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") }) + @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}", 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 +127,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") }) + @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", 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,9 +143,10 @@ 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") }) + @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", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +161,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +45,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +41,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 +55,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") }) + @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", 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 +74,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) }) + @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", 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 +93,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) }) + @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", 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 +112,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) }) + @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", 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 +131,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) }) + @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", 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 +150,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") }) + @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", 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 +169,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +188,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) }) + @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", 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 +222,16 @@ 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 假端點 偽のエンドポイント 가짜 엔드 포인트", 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", 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 +251,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") }) + @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", 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 +276,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") }) + @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", 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 +293,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +312,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +335,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") }) + @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", 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 +354,19 @@ 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)", 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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +45,16 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +33,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 +47,19 @@ 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") }) + @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", 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 +72,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", 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}", 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 +96,19 @@ 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", 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", 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 +122,19 @@ 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", 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", 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 +148,17 @@ 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", 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}", 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 +172,21 @@ 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", 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", 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 +199,18 @@ 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", 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}", 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 +223,19 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +47,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") }) + @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}", 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,11 +65,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", 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", produces = { "application/json" }, method = RequestMethod.GET) @@ -80,15 +87,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") }) + @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}", 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 +108,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +46,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") }) + @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", 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 +63,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") }) + @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", 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 +80,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") }) + @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", 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 +99,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") }) + @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}", 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 +119,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") }) + @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}", 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 +141,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") }) + @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", 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,9 +159,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -166,13 +179,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +41,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 +51,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") }) + @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", 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 +68,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) }) + @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", 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 +85,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) }) + @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", 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 +102,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) }) + @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", 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 +119,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) }) + @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", 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 +136,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") }) + @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", 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 +153,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +170,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) }) + @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", 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 +202,16 @@ 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") }) + @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", 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 +229,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") }) + @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", 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 +252,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") }) + @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", 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 +267,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +284,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +305,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") }) + @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", 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 +322,18 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +31,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 +41,15 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +33,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 +43,19 @@ 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") }) + @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", 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 +66,18 @@ 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") }) + @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}", 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 +88,19 @@ 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") }) + @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", 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 +112,19 @@ 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") }) + @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", 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 +136,17 @@ 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") }) + @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}", 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 +158,21 @@ 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") }) + @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", 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 +183,18 @@ 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") }) + @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}", 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 +205,18 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +43,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") }) + @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}", 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,11 +59,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -72,15 +79,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") }) + @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}", 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 +98,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +32,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 +42,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") }) + @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", 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 +57,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") }) + @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", 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 +72,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") }) + @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", 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 +89,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") }) + @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}", 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 +107,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") }) + @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}", 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 +127,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") }) + @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", 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,9 +143,10 @@ 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") }) + @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", method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -148,12 +161,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,17 @@ 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", 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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +45,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 +59,16 @@ 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", operationId = "createXmlItem", 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,16 @@ 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 = "", 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", 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 +103,16 @@ 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 = "", 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", 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 +134,16 @@ 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 = "", 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", 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 +156,16 @@ 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 = "", 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", 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 +178,16 @@ 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 = "", 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", 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 +200,16 @@ 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 = "", operationId = "testBodyWithQueryParams", 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 +222,17 @@ 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", 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", 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 +268,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 假端點 偽のエンドポイント 가짜 엔드 포인트", 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", 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 +298,11 @@ 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", 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") @@ -295,7 +310,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 +326,17 @@ 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)", 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") }) @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 +348,16 @@ 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", operationId = "testInlineAdditionalProperties", 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 +370,16 @@ 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", operationId = "testJsonFormData", 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 +396,15 @@ 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 = "", 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", 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 +418,21 @@ 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)", 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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,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", 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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +51,21 @@ 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", 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", 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 +78,21 @@ 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", 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") }) @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 +106,21 @@ 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", 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", 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 +149,21 @@ 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", 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", 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 +192,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", 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}", 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 +233,23 @@ 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", 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", 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 +263,20 @@ 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", 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}", 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 +290,21 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +51,16 @@ 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", 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}", 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", 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", @@ -90,17 +97,18 @@ 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", 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}", 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 +135,17 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +50,15 @@ 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", 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", 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,15 @@ 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", operationId = "createUsersWithArrayInput", 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 +90,15 @@ 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", operationId = "createUsersWithListInput", 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 +112,16 @@ 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", 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}", 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 +135,18 @@ 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", 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}", 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 +174,17 @@ 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", 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", 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 +195,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @ApiImplicitParams({ }) @RequestMapping(value = "/user/logout", @@ -205,15 +218,16 @@ 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", 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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +34,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 +48,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +44,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 +58,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") }) + @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", 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 +77,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) }) + @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", 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 +96,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) }) + @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", 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 +115,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) }) + @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", 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 +134,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) }) + @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", 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 +153,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") }) + @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", 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 +172,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +191,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) }) + @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", 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 +225,16 @@ 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") }) + @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", 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 +254,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") }) + @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", 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 +279,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") }) + @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", 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 +296,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +315,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +338,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") }) + @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", 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 +357,19 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +34,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 +48,16 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +36,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 +50,19 @@ 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") }) + @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", 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 +75,18 @@ 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") }) + @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}", 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 +99,19 @@ 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") }) + @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", 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 +125,19 @@ 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") }) + @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", 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 +151,17 @@ 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") }) + @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}", 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 +175,21 @@ 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") }) + @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", 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 +202,18 @@ 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") }) + @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}", 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 +226,19 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +35,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 +50,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") }) + @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}", 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,11 +68,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -83,15 +90,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") }) + @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}", 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 +111,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,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") }) + @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", 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 +66,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") }) + @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", 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 +83,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") }) + @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", 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 +102,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") }) + @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}", 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 +122,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") }) + @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}", 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 +144,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") }) + @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", 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,9 +162,10 @@ 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") }) + @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", method = RequestMethod.GET) default Mono> logoutUser(ServerWebExchange exchange) { @@ -169,13 +182,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +45,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 +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") }) + @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", 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 +79,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) }) + @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", 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 +99,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) }) + @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", 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 +128,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) }) + @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", 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 +148,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) }) + @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", 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 +168,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") }) + @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", 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 +188,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +208,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) }) + @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", 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 +252,16 @@ 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 假端點 偽のエンドポイント 가짜 엔드 포인트", 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", 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 +282,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") }) + @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", 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 +308,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") }) + @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", 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 +326,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +346,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +370,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") }) + @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", 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 +390,19 @@ 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)", 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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,16 @@ 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", 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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +51,19 @@ 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", 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", 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 +77,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", 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}", 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 +102,19 @@ 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", 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", 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 +143,19 @@ 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", 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", 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 +184,17 @@ 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", 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}", 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 +223,21 @@ 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", 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", 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 +251,18 @@ 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", 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}", 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 +276,19 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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}", 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,11 +70,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", 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", produces = { "application/json" }, method = RequestMethod.GET) @@ -86,15 +93,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") }) + @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}", 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 +129,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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", 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 +68,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") }) + @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", 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 +86,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") }) + @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", 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 +106,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") }) + @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}", 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 +127,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") }) + @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}", 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 +164,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") }) + @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", 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,9 +183,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -191,13 +204,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +37,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 +53,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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +47,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 +63,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") }) + @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", 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 +84,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) }) + @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", 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 +105,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) }) + @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", 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 +135,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) }) + @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", 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 +156,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) }) + @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", 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 +177,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") }) + @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", 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 +198,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +219,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) }) + @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", 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 +264,16 @@ 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") }) + @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", 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 +295,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") }) + @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", 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 +322,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") }) + @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", 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 +341,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +362,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +387,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") }) + @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", 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 +408,19 @@ 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) }) + @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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +37,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 +53,16 @@ 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) }) + @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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +39,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 +55,19 @@ 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") }) + @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", 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 +82,18 @@ 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") }) + @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}", 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 +108,19 @@ 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") }) + @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", 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 +150,19 @@ 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") }) + @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", 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 +192,17 @@ 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") }) + @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}", 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 +232,21 @@ 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") }) + @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", 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 +261,18 @@ 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") }) + @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}", 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 +287,19 @@ 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) }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +38,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 +55,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") }) + @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}", 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,11 +75,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") }) + @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", produces = { "application/json" }, method = RequestMethod.GET) @@ -92,15 +99,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") }) + @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}", 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 +136,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +38,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 +54,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") }) + @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", 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 +73,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") }) + @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", 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 +92,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") }) + @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", 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 +113,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") }) + @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}", 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 +135,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") }) + @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}", 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 +173,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") }) + @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", 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,9 +193,10 @@ 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") }) + @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", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -202,13 +215,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") }) + @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}", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +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) }) + @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", 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..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 @@ -16,7 +16,13 @@ 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.security.SecurityRequirement; +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 +45,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 +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") }) + @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", 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 +79,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) }) + @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", 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 +99,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) }) + @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", 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 +128,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) }) + @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", 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 +148,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) }) + @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", 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 +168,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") }) + @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", 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 +188,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") }) + @Operation(summary = "", operationId = "testBodyWithQueryParams", 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 +208,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) }) + @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", 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 +252,16 @@ 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 假端點 偽のエンドポイント 가짜 엔드 포인트", 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", 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 +282,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") }) + @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", 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 +308,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") }) + @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", 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 +326,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") }) + @Operation(summary = "test inline additionalProperties", operationId = "testInlineAdditionalProperties", 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 +346,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") }) + @Operation(summary = "test json serialization of form data", operationId = "testJsonFormData", 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 +370,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") }) + @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", 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 +390,19 @@ 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)", 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", 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..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 @@ -6,7 +6,13 @@ 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.security.SecurityRequirement; +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 +35,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 +49,16 @@ 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", 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", 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..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 @@ -8,7 +8,13 @@ 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.security.SecurityRequirement; +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 +37,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 +51,19 @@ 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", 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", 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 +77,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", 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}", 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 +102,19 @@ 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", 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", 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 +143,19 @@ 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", 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", 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 +184,17 @@ 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", 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}", 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 +223,21 @@ 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", 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", 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 +251,18 @@ 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", 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}", 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 +276,19 @@ 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", 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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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}", 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,11 +70,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", 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", produces = { "application/json" }, method = RequestMethod.GET) @@ -86,15 +93,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") }) + @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}", 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 +129,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") }) + @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", 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..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 @@ -7,7 +7,13 @@ 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.security.SecurityRequirement; +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 +36,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 +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") }) + @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", 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 +68,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") }) + @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", 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 +86,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") }) + @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", 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 +106,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") }) + @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}", 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 +127,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") }) + @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}", 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 +164,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") }) + @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", 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,9 +183,10 @@ 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", operationId = "logoutUser", description = "", + tags={ "user", }, + responses = { + @ApiResponse(responseCode = "200", description = "successful operation" ) }) @RequestMapping(value = "/user/logout", method = RequestMethod.GET) default ResponseEntity logoutUser() { @@ -191,13 +204,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") }) + @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}", 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() {