[Java Spring OAS3] Fix numerous OAS3 related Bugs (#11181)

* Oas3: Remove swagger2 ApiModel and ApiModelProperty from imports when oas3 is true.

* Oas3: Use either swagger v2 or v3; add test config

* Oas3: allowableValues and defaultValues belong to the Schema annotation

* Oas3: use swagger-core.version property in all pom.xml

* gh-11165 remove io.swagger.v3.oas.annotations.parameters.RequestBody

* gh-11168 add import for io.swagger.v3.oas.annotations.Hidden

* Fix formParams.mustache, add dedicated test scripts for the spring generator using oas3.

* Run ./bin/generate-samples.sh

* Run ./bin/generate-samples.sh - new samples

* fix indentation

* Revert to threetenbp 2.9.10 because customInstantDeserializer.mustache is not compatible with threetenbp > 2.9.10.

* apiController.mustache: pull in osa3 imports.

* apiDelegate.mustache: remove io.swagger.annotations.* import

* Remove Hidden (import and usage). Wrap atApiIgnore with useSpringfox.

* fully qualify org.springframework.data.domain.Pageable because endorExtensions.x-spring-paginated is not set during import processing.

* align spring-cloud and spring-boot pom.mustache regarding springfox and oas versions.

* introduce dateTimeParam.mustache

* Apply DateTimeFormat consistently across different parameter types

* revert to springfox 2.9.2

* add newline after parameter

* fix atSchema annotation (use empty description)

* add more spring-*-oas3 test configs

* Update bin/config/spring* test samples

* Fix implicitHeader.mustache - add import, generate use paramDoc.

* rename spring-boot-implicitHeaders-oal3.yaml to spring-boot-implicitHeaders-oas3.yaml

* Add spring oas3 configs to samples.circleci profiles module list

* Use groupId 'org.openapitools.openapi3' for oas3 configs

* Run all spring test configs.

* In OAS3, allowableValues is a String[] array.

* formParams.mustache: Align spacing and newlines with other param templates

* Support @Parameter(hidden = true) instead of ApiIgnore, Formatting: One parameter per line.

* Format method level annotations in api.mustache

* Introduce samples.circleci.spring profile

* Generate all spring samples
This commit is contained in:
cachescrubber
2022-01-02 14:05:46 +01:00
committed by GitHub
parent b0c0461d27
commit e71ee1bf43
728 changed files with 91024 additions and 9444 deletions

View File

@@ -0,0 +1,13 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
java8: "false"
useBeanValidation: true
artifactId: spring-boot-beanvalidation-no-nullable
hideGenerationTimestamp: "true"
openApiNullable: "false"

View File

@@ -0,0 +1,11 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-delegate
hideGenerationTimestamp: "true"
java8: true
delegatePattern: "true"

View File

@@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-implicitHeaders
hideGenerationTimestamp: "true"
implicitHeaders: true

View File

@@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot
snapshotVersion: "true"
oas3: "true"
hideGenerationTimestamp: "true"

View File

@@ -0,0 +1,11 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-reactive
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: springboot-reactive
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"

View File

@@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-useoptional
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"

View File

@@ -0,0 +1,12 @@
generatorName: spring
outputDir: samples/openapi3/client/petstore/spring-cloud-async
library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
async: "true"
java8: "true"
artifactId: petstore-spring-cloud
hideGenerationTimestamp: "true"

View File

@@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-date-time-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@@ -0,0 +1,10 @@
generatorName: spring
library: spring-cloud
outputDir: samples/client/petstore/spring-cloud-date-time
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/date-time-parameter-types-for-testing.yml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: spring-cloud-date-time
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"

View File

@@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@@ -0,0 +1,12 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: spring-cloud-oas3
interfaceOnly: "true"
singleContentTypes: "true"
hideGenerationTimestamp: "true"
oas3: "true"

View File

@@ -0,0 +1,10 @@
generatorName: spring
outputDir: samples/openapi3/client/petstore/spring-cloud-spring-pageable
library: spring-cloud
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-spring-pageable.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
oas3: "true"
artifactId: spring-cloud-spring-pageable
hideGenerationTimestamp: 'true'

View File

@@ -20,6 +20,7 @@ package org.openapitools.codegen.languages;
import static org.apache.commons.lang3.StringUtils.isNotEmpty; import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.camelize;
import io.swagger.v3.oas.models.media.Schema;
import java.io.File; import java.io.File;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
@@ -923,6 +924,17 @@ public class SpringCodegen extends AbstractJavaCodegen
} }
} }
@Override
public CodegenModel fromModel(String name, Schema model) {
CodegenModel codegenModel = super.fromModel(name, model);
if (oas3) {
// remove swagger2 imports
codegenModel.imports.remove("ApiModelProperty");
codegenModel.imports.remove("ApiModel");
}
return codegenModel;
}
@Override @Override
public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) { public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
objs = super.postProcessModelsEnum(objs); objs = super.postProcessModelsEnum(objs);

View File

@@ -0,0 +1 @@
{{#allowableValues}}allowableValues ={{#oas3}} { {{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}} }{{/oas3}}{{^oas3}} "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/oas3}}{{/allowableValues}}

View File

@@ -10,9 +10,9 @@ package {{package}};
{{#oas3}} {{#oas3}}
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@@ -120,29 +120,62 @@ public interface {{classname}} {
@ApiVirtual @ApiVirtual
{{/virtualService}} {{/virtualService}}
{{#oas3}} {{#oas3}}
@Operation(summary = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }, responses = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}}{{/responses}} }{{#hasAuthMethods}},security = { @Operation(
{{#authMethods}}@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} } {{/hasAuthMethods}}) summary = "{{{summary}}}",
{{/oas3}}{{^oas3}} tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
@ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { responses = {
{{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#responses}}
{{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = @Content(mediaType = "application/json", schema = @Schema(implementation = {{{baseType}}}.class)){{/baseType}}){{^-last}},{{/-last}}
{{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{/responses}}
{{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} }{{#hasAuthMethods}},
{{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) security = {
@ApiResponses(value = { {{#responses}} {{#authMethods}}
@SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes={ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} }{{/isOAuth}}){{^-last}},{{/-last}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) {{/authMethods}}
}{{/hasAuthMethods}}
)
{{/oas3}}
{{^oas3}}
@ApiOperation(
tags = { {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} },
value = "{{{summary}}}",
nickname = "{{{operationId}}}",
notes = "{{{notes}}}"{{#returnBaseType}},
response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}},
responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}},
authorizations = {
{{#authMethods}}
{{#isOAuth}}
@Authorization(value = "{{name}}", scopes = {
{{#scopes}}
@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}},{{/-last}}
{{/scopes}}
}){{^-last}},{{/-last}}
{{/isOAuth}}
{{^isOAuth}}
@Authorization(value = "{{name}}"){{^-last}},{{/-last}}
{{/isOAuth}}
{{/authMethods}} }{{/hasAuthMethods}}
)
@ApiResponses({
{{#responses}}
@ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}
{{/responses}}
})
{{/oas3}} {{/oas3}}
{{#implicitHeaders}} {{#implicitHeaders}}
{{#oas3}} {{#oas3}}
@Parameters({ @Parameters({
{{#headerParams}}
{{>paramDoc}}{{^-last}},{{/-last}}
{{/headerParams}}
{{/oas3}} {{/oas3}}
{{^oas3}} {{^oas3}}
@ApiImplicitParams({ @ApiImplicitParams({
{{#headerParams}}
{{>implicitHeader}}{{^-last}},{{/-last}}
{{/headerParams}}
{{/oas3}} {{/oas3}}
{{#headerParams}}
{{>implicitHeader}}
{{/headerParams}}
}) })
{{/implicitHeaders}} {{/implicitHeaders}}
@RequestMapping( @RequestMapping(
@@ -153,13 +186,18 @@ public interface {{classname}} {
produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}}, produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}},
consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}} consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}}
) )
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}(
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
{{/hasParams}}{{#oas3}}@Parameter(hidden = true){{/oas3}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
{{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore {{/useSpringfox}}final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}
){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} {
{{#delegate-method}} {{#delegate-method}}
return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}}); return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}});
} }
// Override this method // Override this method
{{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#oas3}}@Hidden{{/oas3}}{{^oas3}}@springfox.documentation.annotations.ApiIgnore{{/oas3}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore{{/useSpringfox}} final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
{{/delegate-method}} {{/delegate-method}}
{{^isDelegate}} {{^isDelegate}}
{{>methodBody}} {{>methodBody}}

View File

@@ -3,7 +3,18 @@ package {{package}};
{{^jdk8}} {{^jdk8}}
{{#imports}}import {{import}}; {{#imports}}import {{import}};
{{/imports}} {{/imports}}
{{#oas3}}
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
{{/oas3}}
{{^oas3}}
import io.swagger.annotations.*; import io.swagger.annotations.*;
{{/oas3}}
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@@ -118,7 +129,11 @@ public class {{classname}}Controller implements {{classname}} {
{{/externalDocs}} {{/externalDocs}}
* @see {{classname}}#{{operationId}} * @see {{classname}}#{{operationId}}
*/ */
public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}, @springfox.documentation.annotations.ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}) { public {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}(
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
{{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
{{/hasParams}}{{#useSpringfox}}@springfox.documentation.annotations.ApiIgnore {{/useSpringfox}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
) {
{{^isDelegate}} {{^isDelegate}}
{{^async}} {{^async}}
{{>methodBody}} {{>methodBody}}

View File

@@ -2,7 +2,6 @@ package {{package}};
{{#imports}}import {{import}}; {{#imports}}import {{import}};
{{/imports}} {{/imports}}
import io.swagger.annotations.*;
{{#vendorExtensions.x-spring-paginated}} {{#vendorExtensions.x-spring-paginated}}
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
{{/vendorExtensions.x-spring-paginated}} {{/vendorExtensions.x-spring-paginated}}
@@ -73,7 +72,7 @@ public interface {{classname}}Delegate {
*/ */
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final org.springframework.data.domain.Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
{{>methodBody}} {{>methodBody}}
}{{/jdk8-default-interface}} }{{/jdk8-default-interface}}

View File

@@ -1 +1 @@
{{#isBodyParam}}{{#oas3}}@Parameter(name ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}} {{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{{.}}}"{{#oas3}}){{/oas3}}{{/allowableValues}}) {{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} {{#isBodyParam}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}}

View File

@@ -1 +1 @@
{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} {{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isCookieParam}}

View File

@@ -0,0 +1 @@
{{#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}}

View File

@@ -1 +1 @@
{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} {{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}}

View File

@@ -1 +1 @@
{{#isHeaderParam}}{{#oas3}}@Parameter(description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} {{#isHeaderParam}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isHeaderParam}}

View File

@@ -1 +1 @@
{{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}}{{/isHeaderParam}} {{#isHeaderParam}}@ApiImplicitParam(name = "{{{paramName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{/isHeaderParam}}

View File

@@ -10,7 +10,10 @@
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
{{#useSpringfox}} {{#useSpringfox}}
<springfox-version>2.9.2</springfox-version> <springfox.version>2.9.2</springfox.version>
{{/useSpringfox}}
{{^useSpringfox}}
<swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
{{/useSpringfox}} {{/useSpringfox}}
</properties> </properties>
{{#parentOverridden}} {{#parentOverridden}}
@@ -24,7 +27,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>{{#java8}}2.3.3.RELEASE{{/java8}}{{^java8}}1.5.12.RELEASE{{/java8}}</version> <version>2.5.8</version>
</parent> </parent>
{{/parentOverridden}} {{/parentOverridden}}
<build> <build>
@@ -34,13 +37,6 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
{{#apiFirst}} {{#apiFirst}}
<plugin> <plugin>
@@ -91,43 +87,25 @@
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version> <version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency> </dependency>
{{/useSpringfox}} {{/useSpringfox}}
{{^useSpringfox}} {{^useSpringfox}}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>3.14.2</version>
</dependency>
{{#oas3}} {{#oas3}}
<dependency> <dependency>
<groupId>io.swagger.core.v3</groupId> <groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>2.1.2</version> <version>${swagger-core-version}</version>
</dependency> </dependency>
{{/oas3}} {{/oas3}}
{{^oas3}} {{^oas3}}
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>1.5.14</version> <version>${swagger-core-version}</version>
</dependency> </dependency>
{{/oas3}} {{/oas3}}
{{/useSpringfox}}
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
<dependency> <dependency>
<groupId>com.google.code.findbugs</groupId> <groupId>com.google.code.findbugs</groupId>
@@ -138,9 +116,12 @@
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId> <artifactId>jackson-dataformat-yaml</artifactId>
</dependency> </dependency>
{{/useSpringfox}}
{{#withXml}} {{#withXml}}
<!-- XML processing: Jackson --> <!-- XML processing: Jackson -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId> <artifactId>jackson-dataformat-xml</artifactId>
@@ -162,21 +143,21 @@
<dependency> <dependency>
<groupId>com.github.joschi.jackson</groupId> <groupId>com.github.joschi.jackson</groupId>
<artifactId>jackson-datatype-threetenbp</artifactId> <artifactId>jackson-datatype-threetenbp</artifactId>
<version>2.8.4</version> <version>2.9.10</version>
</dependency> </dependency>
{{/threetenbp}} {{/threetenbp}}
{{#openApiNullable}} {{#openApiNullable}}
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version> <version>0.2.2</version>
</dependency> </dependency>
{{/openApiNullable}} {{/openApiNullable}}
{{#useBeanValidation}} {{#useBeanValidation}}
<!-- Bean Validation API support --> <!-- Bean Validation API support -->
<dependency> <dependency>
<groupId>jakarta.validation</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>jakarta.validation-api</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
{{/useBeanValidation}} {{/useBeanValidation}}
{{#virtualService}} {{#virtualService}}

View File

@@ -1 +1 @@
{{#isFormParam}}{{^isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} {{#isFormParam}}{{^isFile}}{{>paramDoc}} @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}){{>dateTimeParam}} {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}}

View File

@@ -9,7 +9,10 @@
<java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version> <java.version>{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version> <swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
{{#useSpringfox}}
<springfox.version>2.9.2</springfox.version>
{{/useSpringfox}}
</properties> </properties>
{{#parentOverridden}} {{#parentOverridden}}
<parent> <parent>
@@ -22,7 +25,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version> <version>2.6.2</version>
</parent> </parent>
{{/parentOverridden}} {{/parentOverridden}}
<build> <build>
@@ -35,7 +38,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId> <artifactId>spring-cloud-starter-parent</artifactId>
<version>2020.0.4</version> <version>2021.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@@ -44,27 +47,37 @@
{{/parentOverridden}} {{/parentOverridden}}
<dependencies> <dependencies>
{{#useSpringfox}}
<!--SpringFox dependencies -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
{{/useSpringfox}}
{{^useSpringfox}}
{{#oas3}} {{#oas3}}
<dependency> <dependency>
<groupId>io.swagger.core.v3</groupId> <groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>2.1.2</version> <version>${swagger-core-version}</version>
</dependency> </dependency>
{{/oas3}} {{/oas3}}
{{^oas3}} {{^oas3}}
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
{{^parentOverridden}}
<version>${swagger-core-version}</version> <version>${swagger-core-version}</version>
{{/parentOverridden}}
</dependency> </dependency>
{{/oas3}} {{/oas3}}
{{/useSpringfox}}
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
<dependency> <dependency>
<groupId>com.google.code.findbugs</groupId> <groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId> <artifactId>jsr305</artifactId>
{{^parentOverridden}}
<version>3.0.2</version> <version>3.0.2</version>
{{/parentOverridden}}
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
@@ -73,7 +86,9 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId> <artifactId>spring-cloud-starter-oauth2</artifactId>
{{^parentOverridden}}
<version>2.2.5.RELEASE</version> <version>2.2.5.RELEASE</version>
{{/parentOverridden}}
</dependency> </dependency>
{{#withXml}} {{#withXml}}
<!-- XML processing: Jackson --> <!-- XML processing: Jackson -->
@@ -107,40 +122,31 @@
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
{{^parentOverridden}} {{^parentOverridden}}
<version>0.2.1</version> <version>0.2.2</version>
{{/parentOverridden}} {{/parentOverridden}}
</dependency> </dependency>
{{/openApiNullable}} {{/openApiNullable}}
{{#hateoas}}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
{{/hateoas}}
{{#useBeanValidation}}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
{{/useBeanValidation}}
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
{{#hateoas}}
<!-- Spring HATEOAS -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
{{/hateoas}}
{{#useBeanValidation}}
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
{{^parentOverridden}}
<version>6.0.16.Final</version>
{{/parentOverridden}}
</dependency>
{{/useBeanValidation}}
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -187,14 +187,14 @@
<dependency> <dependency>
<groupId>io.swagger.core.v3</groupId> <groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>2.1.2</version> <version>${swagger-core-version}</version>
</dependency> </dependency>
{{/oas3}} {{/oas3}}
{{^oas3}} {{^oas3}}
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>1.5.14</version> <version>${swagger-core-version}</version>
</dependency> </dependency>
{{/oas3}} {{/oas3}}
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
@@ -289,12 +289,12 @@
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version> <jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<jakarta.xml.bind-version>2.3.3</jakarta.xml.bind-version> <jakarta.xml.bind-version>2.3.3</jakarta.xml.bind-version>
<jetty-version>9.2.15.v20160210</jetty-version> <jetty-version>9.2.15.v20160210</jetty-version>
<slf4j-version>1.7.21</slf4j-version> <slf4j-version>1.7.21</slf4j-version>
<junit-version>4.13.1</junit-version> <junit-version>4.13.1</junit-version>
<servlet-api-version>4.0.4</servlet-api-version> <servlet-api-version>4.0.4</servlet-api-version>
<springfox-version>2.8.0</springfox-version> <springfox-version>2.9.2</springfox-version>
<jackson-version>2.9.9</jackson-version> <jackson-version>2.9.9</jackson-version>
<jackson-threetenbp-version>2.8.4</jackson-threetenbp-version> <jackson-threetenbp-version>2.8.4</jackson-threetenbp-version>
{{#useBeanValidation}} {{#useBeanValidation}}
@@ -305,5 +305,6 @@
<jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version> <jackson-databind-nullable-version>0.2.2</jackson-databind-nullable-version>
{{/openApiNullable}} {{/openApiNullable}}
<jackson-databind-version>2.9.8</jackson-databind-version> <jackson-databind-version>2.9.8</jackson-databind-version>
<swagger-core-version>{{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}</swagger-core-version>
</properties> </properties>
</project> </project>

View File

@@ -0,0 +1 @@
{{#oas3}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/oas3}}{{^oas3}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/oas3}}

View File

@@ -1 +1 @@
{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{baseName}}", description ={{/oas3}}{{^oas3}}@ApiParam(value ={{/oas3}} "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaRemoveDoubleQuote}}{{{value}}}{{/lambdaRemoveDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} {{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}

View File

@@ -1 +1 @@
{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#oas3}}@Parameter(name = "{{{baseName}}}", description = {{/oas3}}{{^oas3}}@ApiParam(value = {{/oas3}}"{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{#oas3}}schema = @Schema({{/oas3}}allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{#oas3}}){{/oas3}}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/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}} {{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{>dateTimeParam}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}}

View File

@@ -0,0 +1,70 @@
openapi: 3.0.3
info:
title: Api Documentation
description: 'Demo Spring Mvc @DateTimeFormat across the different openapi parameter types'
version: '1.0'
paths:
/thingy/{date}:
post:
description: 'update with form data'
operationId: updatePetWithForm
parameters:
- name: date
in: path
description: 'A date path parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
responses:
'405':
description: Invalid input
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
visitDate:
description: Updated last vist timestamp
type: string
format: date-time
get:
operationId: get
parameters:
- name: date
in: path
description: 'A date path parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
- name: dateTime
description: 'A date-time query parameter'
in: query
required: true
schema:
type: string
format: date-time
example: '1996-12-19T16:39:57-08:00'
- name: X-Order-Date
in: header
description: 'A date header parameter'
required: true
schema:
type: string
format: date
example: '2021-01-01'
- name: loginDate
in: cookie
description: 'A date cookie parameter'
required: false
schema:
type: string
format: date
example: '2021-01-01'
responses:
'200':
description: OK

46
pom.xml
View File

@@ -3,6 +3,7 @@
<groupId>org.sonatype.oss</groupId> <groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId> <artifactId>oss-parent</artifactId>
<version>5</version> <version>5</version>
<relativePath/><!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
@@ -1208,15 +1209,21 @@
<module>samples/server/petstore/jaxrs-resteasy/joda</module> <module>samples/server/petstore/jaxrs-resteasy/joda</module>
<module>samples/server/petstore/jaxrs-resteasy/default-value</module> <module>samples/server/petstore/jaxrs-resteasy/default-value</module>
<!--<module>samples/server/petstore/kotlin-server/ktor</module>--> <!--<module>samples/server/petstore/kotlin-server/ktor</module>-->
<!-- move to other CI as the following fails often in CircleCI
<module>samples/server/petstore/spring-mvc</module>
<module>samples/server/petstore/spring-mvc-j8-async</module>
<module>samples/server/petstore/spring-mvc-j8-localdatetime</module>-->
<module>samples/client/petstore/spring-cloud</module> <module>samples/client/petstore/spring-cloud</module>
<module>samples/openapi3/client/petstore/spring-cloud</module>
<module>samples/client/petstore/spring-cloud-date-time</module>
<module>samples/openapi3/client/petstore/spring-cloud-date-time</module>
<module>samples/server/petstore/springboot</module> <module>samples/server/petstore/springboot</module>
<module>samples/openapi3/server/petstore/springboot</module>
<module>samples/server/petstore/springboot-beanvalidation</module> <module>samples/server/petstore/springboot-beanvalidation</module>
<module>samples/server/petstore/springboot-useoptional</module> <module>samples/server/petstore/springboot-useoptional</module>
<module>samples/openapi3/server/petstore/springboot-useoptional</module>
<module>samples/server/petstore/springboot-reactive</module> <module>samples/server/petstore/springboot-reactive</module>
<module>samples/openapi3/server/petstore/springboot-reactive</module>
<module>samples/server/petstore/springboot-implicitHeaders</module>
<module>samples/openapi3/server/petstore/springboot-implicitHeaders</module>
<module>samples/server/petstore/springboot-delegate</module>
<module>samples/openapi3/server/petstore/springboot-delegate</module>
<module>samples/server/petstore/jaxrs-cxf</module> <module>samples/server/petstore/jaxrs-cxf</module>
<module>samples/server/petstore/jaxrs-cxf-annotated-base-path</module> <module>samples/server/petstore/jaxrs-cxf-annotated-base-path</module>
<module>samples/server/petstore/jaxrs-cxf-cdi</module> <module>samples/server/petstore/jaxrs-cxf-cdi</module>
@@ -1230,6 +1237,37 @@
<module>samples/server/petstore/scala-finch</module> <module>samples/server/petstore/scala-finch</module>
</modules> </modules>
</profile> </profile>
<profile>
<id>samples.circleci.spring</id>
<activation>
<property>
<name>env</name>
<value>samples.circleci.spring</value>
</property>
</activation>
<modules>
<module>samples/server/petstore/spring-mvc</module>
<module>samples/server/petstore/spring-mvc-default-value</module>
<module>samples/server/petstore/spring-mvc-j8-async</module>
<module>samples/server/petstore/spring-mvc-j8-localdatetime</module>
<!-- servers -->
<module>samples/client/petstore/spring-cloud</module>
<module>samples/openapi3/client/petstore/spring-cloud</module>
<module>samples/client/petstore/spring-cloud-date-time</module>
<module>samples/openapi3/client/petstore/spring-cloud-date-time</module>
<module>samples/server/petstore/springboot</module>
<module>samples/openapi3/server/petstore/springboot</module>
<module>samples/server/petstore/springboot-beanvalidation</module>
<module>samples/server/petstore/springboot-useoptional</module>
<module>samples/openapi3/server/petstore/springboot-useoptional</module>
<module>samples/server/petstore/springboot-reactive</module>
<module>samples/openapi3/server/petstore/springboot-reactive</module>
<module>samples/server/petstore/springboot-implicitHeaders</module>
<module>samples/openapi3/server/petstore/springboot-implicitHeaders</module>
<module>samples/server/petstore/springboot-delegate</module>
<module>samples/openapi3/server/petstore/springboot-delegate</module>
</modules>
</profile>
<!-- node 3 tests in CircleCI --> <!-- node 3 tests in CircleCI -->
<profile> <profile>
<id>samples.circleci.node3</id> <id>samples.circleci.node3</id>

View File

@@ -9,12 +9,13 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version> <swagger-core-version>1.6.3</swagger-core-version>
<springfox.version>2.9.2</springfox.version>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version> <version>2.6.2</version>
</parent> </parent>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
@@ -25,7 +26,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId> <artifactId>spring-cloud-starter-parent</artifactId>
<version>2020.0.4</version> <version>2021.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@@ -33,10 +34,11 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<!--SpringFox dependencies -->
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.springfox</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>${swagger-core-version}</version> <version>${springfox.version}</version>
</dependency> </dependency>
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
<dependency> <dependency>
@@ -60,26 +62,20 @@
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version> <version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.16.Final</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -33,23 +33,29 @@ public interface PetApi {
* @param body Pet object that needs to be added to the store (required) * @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Add a new pet to the store",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "addPet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
CompletableFuture<ResponseEntity<Void>> addPet( CompletableFuture<ResponseEntity<Void>> addPet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); );
/** /**
@@ -59,24 +65,29 @@ public interface PetApi {
* @param apiKey (optional) * @param apiKey (optional)
* @return Invalid pet value (status code 400) * @return Invalid pet value (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Deletes a pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "deletePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 400, message = "Invalid pet value") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid pet value")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/pet/{petId}" value = "/pet/{petId}"
) )
CompletableFuture<ResponseEntity<Void>> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId CompletableFuture<ResponseEntity<Void>> deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey );
);
/** /**
@@ -87,25 +98,32 @@ public interface PetApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid status value (status code 400) * or Invalid status value (status code 400)
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by status",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByStatus",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple status values can be provided with comma separated strings",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value")
@ApiResponse(code = 400, message = "Invalid status value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByStatus", value = "/pet/findByStatus",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<List<Pet>>> 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<String> status CompletableFuture<ResponseEntity<List<Pet>>> 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<String> status
); );
/** /**
@@ -117,25 +135,32 @@ public interface PetApi {
* or Invalid tag value (status code 400) * or Invalid tag value (status code 400)
* @deprecated * @deprecated
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by tags",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByTags",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value")
@ApiResponse(code = 400, message = "Invalid tag value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByTags", value = "/pet/findByTags",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags(
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags
); );
/** /**
@@ -147,26 +172,29 @@ public interface PetApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Pet not found (status code 404) * or Pet not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { tags = { "pet" },
value = "Find pet by ID",
@Authorization(value = "api_key") nickname = "getPetById",
}, tags={ "pet", }) notes = "Returns a single pet",
@ApiResponses(value = { response = Pet.class,
authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found")
@ApiResponse(code = 404, message = "Pet not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/{petId}", value = "/pet/{petId}",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<Pet>> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId CompletableFuture<ResponseEntity<Pet>> getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
); );
/** /**
@@ -177,27 +205,31 @@ public interface PetApi {
* or Pet not found (status code 404) * or Pet not found (status code 404)
* or Validation exception (status code 405) * or Validation exception (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Update an existing pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception")
@ApiResponse(code = 405, message = "Validation exception") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
CompletableFuture<ResponseEntity<Void>> updatePet( CompletableFuture<ResponseEntity<Void>> updatePet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); );
/** /**
@@ -208,27 +240,31 @@ public interface PetApi {
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Updates a pet in the store with form data",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePetWithForm",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}", value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded" consumes = "application/x-www-form-urlencoded"
) )
CompletableFuture<ResponseEntity<Void>> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId CompletableFuture<ResponseEntity<Void>> updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) String name,
@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) String status
@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);
/** /**
@@ -239,27 +275,32 @@ public interface PetApi {
* @param file file to upload (optional) * @param file file to upload (optional)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "uploads an image",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "uploadFile",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = ModelApiResponse.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage", value = "/pet/{petId}/uploadImage",
produces = "application/json", produces = "application/json",
consumes = "multipart/form-data" consumes = "multipart/form-data"
) )
CompletableFuture<ResponseEntity<ModelApiResponse>> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId CompletableFuture<ResponseEntity<ModelApiResponse>> 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
@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, );
@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file);
} }

View File

@@ -35,20 +35,23 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400) * @return Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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"
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/store/order/{orderId}" value = "/store/order/{orderId}"
) )
CompletableFuture<ResponseEntity<Void>> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId CompletableFuture<ResponseEntity<Void>> deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
); );
/** /**
@@ -57,20 +60,28 @@ public interface StoreApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { tags = { "store" },
value = "Returns pet inventories by status",
@Authorization(value = "api_key") nickname = "getInventory",
}, tags={ "store", }) notes = "Returns a map of status codes to quantities",
@ApiResponses(value = { response = Integer.class,
responseContainer = "Map",
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/inventory", value = "/store/inventory",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory(); CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory(
);
/** /**
@@ -82,23 +93,26 @@ public interface StoreApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/order/{orderId}", value = "/store/order/{orderId}",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<Order>> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId CompletableFuture<ResponseEntity<Order>> getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
); );
/** /**
@@ -108,20 +122,24 @@ public interface StoreApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid Order (status code 400) * or Invalid Order (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) tags = { "store" },
@ApiResponses(value = { value = "Place an order for a pet",
nickname = "placeOrder",
notes = "",
response = Order.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order")
@ApiResponse(code = 400, message = "Invalid Order") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/store/order", value = "/store/order",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<Order>> placeOrder( CompletableFuture<ResponseEntity<Order>> placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); );
} }

View File

@@ -35,18 +35,22 @@ public interface UserApi {
* @param body Created user object (required) * @param body Created user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Create user",
nickname = "createUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user" value = "/user"
) )
CompletableFuture<ResponseEntity<Void>> createUser( CompletableFuture<ResponseEntity<Void>> createUser(
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); );
/** /**
@@ -55,18 +59,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithArrayInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithArray" value = "/user/createWithArray"
) )
CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput( CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body); );
/** /**
@@ -75,18 +83,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithListInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithList" value = "/user/createWithList"
) )
CompletableFuture<ResponseEntity<Void>> createUsersWithListInput( CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body); );
/** /**
@@ -97,20 +109,23 @@ public interface UserApi {
* @return Invalid username supplied (status code 400) * @return Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Delete user",
nickname = "deleteUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/user/{username}" value = "/user/{username}"
) )
CompletableFuture<ResponseEntity<Void>> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username CompletableFuture<ResponseEntity<Void>> deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
); );
/** /**
@@ -121,23 +136,26 @@ public interface UserApi {
* or Invalid username supplied (status code 400) * or Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Get user by user name",
nickname = "getUserByName",
notes = "",
response = User.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/{username}", value = "/user/{username}",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<User>> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username CompletableFuture<ResponseEntity<User>> getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
); );
/** /**
@@ -148,23 +166,26 @@ public interface UserApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400) * or Invalid username/password supplied (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs user into the system",
nickname = "loginUser",
notes = "",
response = String.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied")
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/login", value = "/user/login",
produces = "application/json" produces = "application/json"
) )
CompletableFuture<ResponseEntity<String>> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username CompletableFuture<ResponseEntity<String>> loginUser(
@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
);
);
/** /**
@@ -172,16 +193,22 @@ public interface UserApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs out current logged in user session",
nickname = "logoutUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/logout" value = "/user/logout"
) )
CompletableFuture<ResponseEntity<Void>> logoutUser(); CompletableFuture<ResponseEntity<Void>> logoutUser(
);
/** /**
@@ -193,21 +220,23 @@ public interface UserApi {
* @return Invalid user supplied (status code 400) * @return Invalid user supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Updated user",
nickname = "updateUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/user/{username}" value = "/user/{username}"
) )
CompletableFuture<ResponseEntity<Void>> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username CompletableFuture<ResponseEntity<Void>> updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
);
@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body);
} }

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,3 @@
README.md
pom.xml
src/main/java/org/openapitools/api/DefaultApi.java

View File

@@ -0,0 +1 @@
5.4.0-SNAPSHOT

View File

@@ -0,0 +1,26 @@
# OpenAPI generated API stub
Spring Framework stub
## Overview
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
This is an example of building API stub interfaces in Java using the Spring framework.
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
by adding ```@Controller``` classes that implement the interface. Eg:
```java
@Controller
public class PetController implements PetApi {
// implement all PetApi methods
}
```
You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg:
```java
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
public interface PetClient extends PetApi {
}
```

View File

@@ -0,0 +1,81 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>spring-cloud-date-time</artifactId>
<packaging>jar</packaging>
<name>spring-cloud-date-time</name>
<version>1.0</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.6.3</swagger-core-version>
<springfox.version>2.9.2</springfox.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2021.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--SpringFox dependencies -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox.version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,86 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Api(value = "Default", description = "the Default API")
public interface DefaultApi {
/**
* GET /thingy/{date}
*
* @param date A date path parameter (required)
* @param dateTime A date-time query parameter (required)
* @param xOrderDate A date header parameter (required)
* @param loginDate A date cookie parameter (optional)
* @return OK (status code 200)
*/
@ApiOperation(
tags = { },
value = "",
nickname = "get",
notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "OK")
})
@RequestMapping(
method = RequestMethod.GET,
value = "/thingy/{date}"
)
ResponseEntity<Void> get(
@ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date,
@NotNull @ApiParam(value = "A date-time query parameter", required = true) @Valid @RequestParam(value = "dateTime", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
@ApiParam(value = "A date header parameter", required = true) @RequestHeader(value = "X-Order-Date", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate xOrderDate,
@ApiParam(value = "A date cookie parameter") @CookieValue("loginDate") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate loginDate
);
/**
* POST /thingy/{date}
* update with form data
*
* @param date A date path parameter (required)
* @param visitDate Updated last vist timestamp (optional)
* @return Invalid input (status code 405)
*/
@ApiOperation(
tags = { },
value = "",
nickname = "updatePetWithForm",
notes = "update with form data"
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping(
method = RequestMethod.POST,
value = "/thingy/{date}",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> updatePetWithForm(
@ApiParam(value = "A date path parameter", required = true) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date,
@ApiParam(value = "Updated last vist timestamp") @RequestParam(value="visitDate", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate
);
}

View File

@@ -9,12 +9,13 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version> <swagger-core-version>1.6.3</swagger-core-version>
<springfox.version>2.9.2</springfox.version>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version> <version>2.6.2</version>
</parent> </parent>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
@@ -25,7 +26,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId> <artifactId>spring-cloud-starter-parent</artifactId>
<version>2020.0.4</version> <version>2021.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@@ -33,10 +34,11 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<!--SpringFox dependencies -->
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.springfox</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>${swagger-core-version}</version> <version>${springfox.version}</version>
</dependency> </dependency>
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
<dependency> <dependency>
@@ -60,26 +62,20 @@
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version> <version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.16.Final</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -32,23 +32,29 @@ public interface PetApi {
* @param body Pet object that needs to be added to the store (required) * @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Add a new pet to the store",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "addPet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> addPet( ResponseEntity<Void> addPet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); );
/** /**
@@ -58,24 +64,29 @@ public interface PetApi {
* @param apiKey (optional) * @param apiKey (optional)
* @return Invalid pet value (status code 400) * @return Invalid pet value (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Deletes a pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "deletePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 400, message = "Invalid pet value") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid pet value")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/pet/{petId}" value = "/pet/{petId}"
) )
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId ResponseEntity<Void> deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey );
);
/** /**
@@ -86,25 +97,33 @@ public interface PetApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid status value (status code 400) * or Invalid status value (status code 400)
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by status",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByStatus",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple status values can be provided with comma separated strings",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value")
@ApiResponse(code = 400, message = "Invalid status value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByStatus", value = "/pet/findByStatus",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<List<Pet>> 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<String> status ResponseEntity<List<Pet>> 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<String> status,
, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable
);
/** /**
@@ -116,25 +135,33 @@ public interface PetApi {
* or Invalid tag value (status code 400) * or Invalid tag value (status code 400)
* @deprecated * @deprecated
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by tags",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByTags",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value")
@ApiResponse(code = 400, message = "Invalid tag value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByTags", value = "/pet/findByTags",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<List<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags ResponseEntity<List<Pet>> findPetsByTags(
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags,
, @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable); @springfox.documentation.annotations.ApiIgnore final org.springframework.data.domain.Pageable pageable
);
/** /**
@@ -146,26 +173,29 @@ public interface PetApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Pet not found (status code 404) * or Pet not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { tags = { "pet" },
value = "Find pet by ID",
@Authorization(value = "api_key") nickname = "getPetById",
}, tags={ "pet", }) notes = "Returns a single pet",
@ApiResponses(value = { response = Pet.class,
authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found")
@ApiResponse(code = 404, message = "Pet not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/{petId}", value = "/pet/{petId}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ResponseEntity<Pet> getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
); );
/** /**
@@ -176,27 +206,31 @@ public interface PetApi {
* or Pet not found (status code 404) * or Pet not found (status code 404)
* or Validation exception (status code 405) * or Validation exception (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Update an existing pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception")
@ApiResponse(code = 405, message = "Validation exception") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> updatePet( ResponseEntity<Void> updatePet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body); );
/** /**
@@ -207,27 +241,31 @@ public interface PetApi {
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Updates a pet in the store with form data",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePetWithForm",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}", value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded" consumes = "application/x-www-form-urlencoded"
) )
ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId ResponseEntity<Void> updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) String name,
@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) String status
@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);
/** /**
@@ -238,27 +276,32 @@ public interface PetApi {
* @param file file to upload (optional) * @param file file to upload (optional)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "uploads an image",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "uploadFile",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = ModelApiResponse.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage", value = "/pet/{petId}/uploadImage",
produces = "application/json", produces = "application/json",
consumes = "multipart/form-data" consumes = "multipart/form-data"
) )
ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ResponseEntity<ModelApiResponse> 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
@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, );
@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file);
} }

View File

@@ -34,20 +34,23 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400) * @return Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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"
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/store/order/{orderId}" value = "/store/order/{orderId}"
) )
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ResponseEntity<Void> deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
); );
/** /**
@@ -56,20 +59,28 @@ public interface StoreApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { tags = { "store" },
value = "Returns pet inventories by status",
@Authorization(value = "api_key") nickname = "getInventory",
}, tags={ "store", }) notes = "Returns a map of status codes to quantities",
@ApiResponses(value = { response = Integer.class,
responseContainer = "Map",
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/inventory", value = "/store/inventory",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Map<String, Integer>> getInventory(); ResponseEntity<Map<String, Integer>> getInventory(
);
/** /**
@@ -81,23 +92,26 @@ public interface StoreApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/order/{orderId}", value = "/store/order/{orderId}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ResponseEntity<Order> getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
); );
/** /**
@@ -107,20 +121,24 @@ public interface StoreApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid Order (status code 400) * or Invalid Order (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) tags = { "store" },
@ApiResponses(value = { value = "Place an order for a pet",
nickname = "placeOrder",
notes = "",
response = Order.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order")
@ApiResponse(code = 400, message = "Invalid Order") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/store/order", value = "/store/order",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Order> placeOrder( ResponseEntity<Order> placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body); );
} }

View File

@@ -34,18 +34,22 @@ public interface UserApi {
* @param body Created user object (required) * @param body Created user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Create user",
nickname = "createUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user" value = "/user"
) )
ResponseEntity<Void> createUser( ResponseEntity<Void> createUser(
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body); );
/** /**
@@ -54,18 +58,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithArrayInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithArray" value = "/user/createWithArray"
) )
ResponseEntity<Void> createUsersWithArrayInput( ResponseEntity<Void> createUsersWithArrayInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body); );
/** /**
@@ -74,18 +82,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithListInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithList" value = "/user/createWithList"
) )
ResponseEntity<Void> createUsersWithListInput( ResponseEntity<Void> createUsersWithListInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body); );
/** /**
@@ -96,20 +108,23 @@ public interface UserApi {
* @return Invalid username supplied (status code 400) * @return Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Delete user",
nickname = "deleteUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/user/{username}" value = "/user/{username}"
) )
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ResponseEntity<Void> deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
); );
/** /**
@@ -120,23 +135,26 @@ public interface UserApi {
* or Invalid username supplied (status code 400) * or Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Get user by user name",
nickname = "getUserByName",
notes = "",
response = User.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/{username}", value = "/user/{username}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ResponseEntity<User> getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
); );
/** /**
@@ -147,23 +165,26 @@ public interface UserApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400) * or Invalid username/password supplied (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs user into the system",
nickname = "loginUser",
notes = "",
response = String.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied")
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/login", value = "/user/login",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<String> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username ResponseEntity<String> loginUser(
@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
);
);
/** /**
@@ -171,16 +192,22 @@ public interface UserApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs out current logged in user session",
nickname = "logoutUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/logout" value = "/user/logout"
) )
ResponseEntity<Void> logoutUser(); ResponseEntity<Void> logoutUser(
);
/** /**
@@ -188,16 +215,22 @@ public interface UserApi {
* *
* @return endpoint configuration response (status code 200) * @return endpoint configuration response (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "logoutUserOptions", nickname = "logoutUserOptions", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "logoutUserOptions",
nickname = "logoutUserOptions",
@ApiResponse(code = 200, message = "endpoint configuration response") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "endpoint configuration response")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.OPTIONS, method = RequestMethod.OPTIONS,
value = "/user/logout" value = "/user/logout"
) )
ResponseEntity<Void> logoutUserOptions(); ResponseEntity<Void> logoutUserOptions(
);
/** /**
@@ -209,21 +242,23 @@ public interface UserApi {
* @return Invalid user supplied (status code 400) * @return Invalid user supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Updated user",
nickname = "updateUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/user/{username}" value = "/user/{username}"
) )
ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username ResponseEntity<Void> updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
);
@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body);
} }

View File

@@ -9,12 +9,13 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version> <swagger-core-version>1.6.3</swagger-core-version>
<springfox.version>2.9.2</springfox.version>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.5</version> <version>2.6.2</version>
</parent> </parent>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
@@ -25,7 +26,7 @@
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId> <artifactId>spring-cloud-starter-parent</artifactId>
<version>2020.0.4</version> <version>2021.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@@ -33,10 +34,11 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<!--SpringFox dependencies -->
<dependency> <dependency>
<groupId>io.swagger</groupId> <groupId>io.springfox</groupId>
<artifactId>swagger-annotations</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>${swagger-core-version}</version> <version>${springfox.version}</version>
</dependency> </dependency>
<!-- @Nullable annotation --> <!-- @Nullable annotation -->
<dependency> <dependency>
@@ -60,26 +62,20 @@
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version> <version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.16.Final</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -33,17 +33,23 @@ public interface PetApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid input (status code 405) * or Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", response = Pet.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Add a new pet to the store",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "addPet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 405, message = "Invalid input")
@ApiResponse(code = 405, message = "Invalid input") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet", value = "/pet",
@@ -51,8 +57,8 @@ public interface PetApi {
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Pet> addPet( ResponseEntity<Pet> addPet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet pet); );
/** /**
@@ -62,24 +68,29 @@ public interface PetApi {
* @param apiKey (optional) * @param apiKey (optional)
* @return Invalid pet value (status code 400) * @return Invalid pet value (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Deletes a pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "deletePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 400, message = "Invalid pet value") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid pet value")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/pet/{petId}" value = "/pet/{petId}"
) )
ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId ResponseEntity<Void> deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey );
);
/** /**
@@ -90,24 +101,31 @@ public interface PetApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid status value (status code 400) * or Invalid status value (status code 400)
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by status",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) nickname = "findPetsByStatus",
}, tags={ "pet", }) notes = "Multiple status values can be provided with comma separated strings",
@ApiResponses(value = { response = Pet.class,
responseContainer = "List",
authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value")
@ApiResponse(code = 400, message = "Invalid status value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByStatus", value = "/pet/findByStatus",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<List<Pet>> 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<String> status ResponseEntity<List<Pet>> 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<String> status
); );
/** /**
@@ -119,24 +137,31 @@ public interface PetApi {
* or Invalid tag value (status code 400) * or Invalid tag value (status code 400)
* @deprecated * @deprecated
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by tags",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) nickname = "findPetsByTags",
}, tags={ "pet", }) notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
@ApiResponses(value = { response = Pet.class,
responseContainer = "List",
authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value")
@ApiResponse(code = 400, message = "Invalid tag value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByTags", value = "/pet/findByTags",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<List<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags ResponseEntity<List<Pet>> findPetsByTags(
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags
); );
/** /**
@@ -148,26 +173,29 @@ public interface PetApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Pet not found (status code 404) * or Pet not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { tags = { "pet" },
value = "Find pet by ID",
@Authorization(value = "api_key") nickname = "getPetById",
}, tags={ "pet", }) notes = "Returns a single pet",
@ApiResponses(value = { response = Pet.class,
authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found")
@ApiResponse(code = 404, message = "Pet not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/{petId}", value = "/pet/{petId}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ResponseEntity<Pet> getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
); );
/** /**
@@ -179,21 +207,25 @@ public interface PetApi {
* or Pet not found (status code 404) * or Pet not found (status code 404)
* or Validation exception (status code 405) * or Validation exception (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", response = Pet.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Update an existing pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception")
@ApiResponse(code = 405, message = "Validation exception") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/pet", value = "/pet",
@@ -201,8 +233,8 @@ public interface PetApi {
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Pet> updatePet( ResponseEntity<Pet> updatePet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet pet); );
/** /**
@@ -213,27 +245,31 @@ public interface PetApi {
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Updates a pet in the store with form data",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePetWithForm",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}", value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded" consumes = "application/x-www-form-urlencoded"
) )
ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId ResponseEntity<Void> updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) String name,
@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) String status
@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);
/** /**
@@ -244,27 +280,32 @@ public interface PetApi {
* @param file file to upload (optional) * @param file file to upload (optional)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "uploads an image",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "uploadFile",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = ModelApiResponse.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage", value = "/pet/{petId}/uploadImage",
produces = "application/json", produces = "application/json",
consumes = "multipart/form-data" consumes = "multipart/form-data"
) )
ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ResponseEntity<ModelApiResponse> 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
@ApiParam(value = "Additional data to pass to server" ) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata, );
@ApiParam(value = "file to upload") @RequestParam("file") MultipartFile file);
} }

View File

@@ -34,20 +34,23 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400) * @return Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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"
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/store/order/{orderId}" value = "/store/order/{orderId}"
) )
ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ResponseEntity<Void> deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
); );
/** /**
@@ -56,20 +59,28 @@ public interface StoreApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { tags = { "store" },
value = "Returns pet inventories by status",
@Authorization(value = "api_key") nickname = "getInventory",
}, tags={ "store", }) notes = "Returns a map of status codes to quantities",
@ApiResponses(value = { response = Integer.class,
responseContainer = "Map",
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/inventory", value = "/store/inventory",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Map<String, Integer>> getInventory(); ResponseEntity<Map<String, Integer>> getInventory(
);
/** /**
@@ -81,23 +92,26 @@ public interface StoreApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/order/{orderId}", value = "/store/order/{orderId}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ResponseEntity<Order> getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
); );
/** /**
@@ -107,13 +121,17 @@ public interface StoreApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid Order (status code 400) * or Invalid Order (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) tags = { "store" },
@ApiResponses(value = { value = "Place an order for a pet",
nickname = "placeOrder",
notes = "",
response = Order.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order")
@ApiResponse(code = 400, message = "Invalid Order") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/store/order", value = "/store/order",
@@ -121,7 +139,7 @@ public interface StoreApi {
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Order> placeOrder( ResponseEntity<Order> placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order order); );
} }

View File

@@ -34,22 +34,26 @@ public interface UserApi {
* @param user Created user object (required) * @param user Created user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", authorizations = { tags = { "user" },
value = "Create user",
@Authorization(value = "api_key") nickname = "createUser",
}, tags={ "user", }) notes = "This can only be done by the logged in user.",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
@ApiResponse(code = 200, message = "successful operation") }) }
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user", value = "/user",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> createUser( ResponseEntity<Void> createUser(
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user
@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User user); );
/** /**
@@ -58,22 +62,26 @@ public interface UserApi {
* @param user List of user object (required) * @param user List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", authorizations = { tags = { "user" },
value = "Creates list of users with given input array",
@Authorization(value = "api_key") nickname = "createUsersWithArrayInput",
}, tags={ "user", }) notes = "",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
@ApiResponse(code = 200, message = "successful operation") }) }
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithArray", value = "/user/createWithArray",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> createUsersWithArrayInput( ResponseEntity<Void> createUsersWithArrayInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> user); );
/** /**
@@ -82,22 +90,26 @@ public interface UserApi {
* @param user List of user object (required) * @param user List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", authorizations = { tags = { "user" },
value = "Creates list of users with given input array",
@Authorization(value = "api_key") nickname = "createUsersWithListInput",
}, tags={ "user", }) notes = "",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
@ApiResponse(code = 200, message = "successful operation") }) }
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithList", value = "/user/createWithList",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> createUsersWithListInput( ResponseEntity<Void> createUsersWithListInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> user
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> user); );
/** /**
@@ -108,23 +120,26 @@ public interface UserApi {
* @return Invalid username supplied (status code 400) * @return Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", authorizations = { tags = { "user" },
value = "Delete user",
@Authorization(value = "api_key") nickname = "deleteUser",
}, tags={ "user", }) notes = "This can only be done by the logged in user.",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/user/{username}" value = "/user/{username}"
) )
ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ResponseEntity<Void> deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
); );
/** /**
@@ -135,23 +150,26 @@ public interface UserApi {
* or Invalid username supplied (status code 400) * or Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Get user by user name",
nickname = "getUserByName",
notes = "",
response = User.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/{username}", value = "/user/{username}",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ResponseEntity<User> getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
); );
/** /**
@@ -162,23 +180,26 @@ public interface UserApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400) * or Invalid username/password supplied (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs user into the system",
nickname = "loginUser",
notes = "",
response = String.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied")
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/login", value = "/user/login",
produces = "application/json" produces = "application/json"
) )
ResponseEntity<String> loginUser(@NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username ResponseEntity<String> loginUser(
@NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
);
);
/** /**
@@ -186,19 +207,25 @@ public interface UserApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", authorizations = { tags = { "user" },
value = "Logs out current logged in user session",
@Authorization(value = "api_key") nickname = "logoutUser",
}, tags={ "user", }) notes = "",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
@ApiResponse(code = 200, message = "successful operation") }) }
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/logout" value = "/user/logout"
) )
ResponseEntity<Void> logoutUser(); ResponseEntity<Void> logoutUser(
);
/** /**
@@ -210,25 +237,27 @@ public interface UserApi {
* @return Invalid user supplied (status code 400) * @return Invalid user supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", authorizations = { tags = { "user" },
value = "Updated user",
@Authorization(value = "api_key") nickname = "updateUser",
}, tags={ "user", }) notes = "This can only be done by the logged in user.",
@ApiResponses(value = { authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/user/{username}", value = "/user/{username}",
consumes = "application/json" consumes = "application/json"
) )
ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username ResponseEntity<Void> updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user
);
@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User user);
} }

View File

@@ -9,12 +9,12 @@
<java.version>1.8</java.version> <java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<springfox-version>2.9.2</springfox-version> <springfox.version>2.9.2</springfox.version>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.3.RELEASE</version> <version>2.5.8</version>
</parent> </parent>
<build> <build>
<sourceDirectory>src/main/java</sourceDirectory> <sourceDirectory>src/main/java</sourceDirectory>
@@ -32,16 +32,17 @@
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
<version>${springfox-version}</version> <version>${springfox.version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>springfox-swagger-ui</artifactId> <artifactId>jackson-dataformat-yaml</artifactId>
<version>${springfox-version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.datatype</groupId> <groupId>com.fasterxml.jackson.datatype</groupId>
@@ -50,12 +51,12 @@
<dependency> <dependency>
<groupId>org.openapitools</groupId> <groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId> <artifactId>jackson-databind-nullable</artifactId>
<version>0.2.1</version> <version>0.2.2</version>
</dependency> </dependency>
<!-- Bean Validation API support --> <!-- Bean Validation API support -->
<dependency> <dependency>
<groupId>jakarta.validation</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>jakarta.validation-api</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>

View File

@@ -36,23 +36,29 @@ public interface PetApi {
* @param body Pet object that needs to be added to the store (required) * @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Add a new pet to the store", nickname = "addPet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Add a new pet to the store",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "addPet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
default ResponseEntity<Void> addPet( default ResponseEntity<Void> addPet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -65,24 +71,29 @@ public interface PetApi {
* @param apiKey (optional) * @param apiKey (optional)
* @return Invalid pet value (status code 400) * @return Invalid pet value (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Deletes a pet", nickname = "deletePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Deletes a pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "deletePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 400, message = "Invalid pet value") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid pet value")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/pet/{petId}" value = "/pet/{petId}"
) )
default ResponseEntity<Void> deletePet(@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId default ResponseEntity<Void> deletePet(
@ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
@ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey ) {
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -96,25 +107,32 @@ public interface PetApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid status value (status code 400) * or Invalid status value (status code 400)
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by status",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByStatus",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple status values can be provided with comma separated strings",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid status value")
@ApiResponse(code = 400, message = "Invalid status value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByStatus", value = "/pet/findByStatus",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<List<Pet>> 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<String> status default ResponseEntity<List<Pet>> 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<String> status
) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
@@ -143,25 +161,32 @@ public interface PetApi {
* or Invalid tag value (status code 400) * or Invalid tag value (status code 400)
* @deprecated * @deprecated
*/ */
@ApiOperation(
@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 = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Finds Pets by tags",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "findPetsByTags",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
}, tags={ "pet", }) response = Pet.class,
@ApiResponses(value = { 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")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
@ApiResponse(code = 400, message = "Invalid tag value")
@ApiResponse(code = 400, message = "Invalid tag value") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/findByTags", value = "/pet/findByTags",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<List<Pet>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags default ResponseEntity<List<Pet>> findPetsByTags(
@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List<String> tags
) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
@@ -190,26 +215,29 @@ public interface PetApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Pet not found (status code 404) * or Pet not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = { tags = { "pet" },
value = "Find pet by ID",
@Authorization(value = "api_key") nickname = "getPetById",
}, tags={ "pet", }) notes = "Returns a single pet",
@ApiResponses(value = { response = Pet.class,
authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found")
@ApiResponse(code = 404, message = "Pet not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/pet/{petId}", value = "/pet/{petId}",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<Pet> getPetById(@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId default ResponseEntity<Pet> getPetById(
@ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
@@ -237,27 +265,31 @@ public interface PetApi {
* or Pet not found (status code 404) * or Pet not found (status code 404)
* or Validation exception (status code 405) * or Validation exception (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Update an existing pet", nickname = "updatePet", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Update an existing pet",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePet",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Pet not found"), @ApiResponse(code = 404, message = "Pet not found"),
@ApiResponse(code = 405, message = "Validation exception")
@ApiResponse(code = 405, message = "Validation exception") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/pet", value = "/pet",
consumes = "application/json" consumes = "application/json"
) )
default ResponseEntity<Void> updatePet( default ResponseEntity<Void> updatePet(
@ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@ApiParam(value = "Pet object that needs to be added to the store", required = true ) @Valid @RequestBody Pet body) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -271,27 +303,31 @@ public interface PetApi {
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @return Invalid input (status code 405) * @return Invalid input (status code 405)
*/ */
@ApiOperation(
@ApiOperation(value = "Updates a pet in the store with form data", nickname = "updatePetWithForm", notes = "", authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "Updates a pet in the store with form data",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "updatePetWithForm",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) authorizations = {
@ApiResponses(value = { @Authorization(value = "petstore_auth", scopes = {
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@ApiResponse(code = 405, message = "Invalid input") }) @AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 405, message = "Invalid input")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}", value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded" consumes = "application/x-www-form-urlencoded"
) )
default ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId default ResponseEntity<Void> updatePetWithForm(
@ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,
@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status
@ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, ) {
@ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -305,28 +341,33 @@ public interface PetApi {
* @param file file to upload (optional) * @param file file to upload (optional)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "uploads an image", nickname = "uploadFile", notes = "", response = ModelApiResponse.class, authorizations = { tags = { "pet" },
@Authorization(value = "petstore_auth", scopes = { value = "uploads an image",
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), nickname = "uploadFile",
@AuthorizationScope(scope = "read:pets", description = "read your pets") }) notes = "",
}, tags={ "pet", }) response = ModelApiResponse.class,
@ApiResponses(value = { authorizations = {
@Authorization(value = "petstore_auth", scopes = {
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
@AuthorizationScope(scope = "read:pets", description = "read your pets")
})
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage", value = "/pet/{petId}/uploadImage",
produces = "application/json", produces = "application/json",
consumes = "multipart/form-data" consumes = "multipart/form-data"
) )
default ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId default ResponseEntity<ModelApiResponse> uploadFile(
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
, @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
@ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, ) {
@ApiParam(value = "file to upload") @Valid @RequestPart(value = "file", required = false) MultipartFile file) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {

View File

@@ -38,20 +38,23 @@ public interface StoreApi {
* @return Invalid ID supplied (status code 400) * @return Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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"
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/store/order/{orderId}" value = "/store/order/{orderId}"
) )
default ResponseEntity<Void> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId default ResponseEntity<Void> deleteOrder(
@ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId
) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -63,20 +66,28 @@ public interface StoreApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { tags = { "store" },
value = "Returns pet inventories by status",
@Authorization(value = "api_key") nickname = "getInventory",
}, tags={ "store", }) notes = "Returns a map of status codes to quantities",
@ApiResponses(value = { response = Integer.class,
responseContainer = "Map",
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") }) authorizations = {
@Authorization(value = "api_key")
}
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/inventory", value = "/store/inventory",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<Map<String, Integer>> getInventory() { default ResponseEntity<Map<String, Integer>> getInventory(
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -91,23 +102,26 @@ public interface StoreApi {
* or Invalid ID supplied (status code 400) * or Invalid ID supplied (status code 400)
* or Order not found (status code 404) * or Order not found (status code 404)
*/ */
@ApiOperation(
@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", }) tags = { "store" },
@ApiResponses(value = { 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
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid ID supplied"), @ApiResponse(code = 400, message = "Invalid ID supplied"),
@ApiResponse(code = 404, message = "Order not found")
@ApiResponse(code = 404, message = "Order not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/store/order/{orderId}", value = "/store/order/{orderId}",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<Order> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId default ResponseEntity<Order> getOrderById(
@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
@@ -134,21 +148,25 @@ public interface StoreApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid Order (status code 400) * or Invalid Order (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Place an order for a pet", nickname = "placeOrder", notes = "", response = Order.class, tags={ "store", }) tags = { "store" },
@ApiResponses(value = { value = "Place an order for a pet",
nickname = "placeOrder",
notes = "",
response = Order.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 200, message = "successful operation", response = Order.class),
@ApiResponse(code = 400, message = "Invalid Order")
@ApiResponse(code = 400, message = "Invalid Order") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/store/order", value = "/store/order",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<Order> placeOrder( default ResponseEntity<Order> placeOrder(
@ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
@ApiParam(value = "order placed for purchasing the pet", required = true ) @Valid @RequestBody Order body) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {

View File

@@ -38,18 +38,22 @@ public interface UserApi {
* @param body Created user object (required) * @param body Created user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Create user", nickname = "createUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Create user",
nickname = "createUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user" value = "/user"
) )
default ResponseEntity<Void> createUser( default ResponseEntity<Void> createUser(
@ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
@ApiParam(value = "Created user object", required = true ) @Valid @RequestBody User body) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -61,18 +65,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithArrayInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithArrayInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithArray" value = "/user/createWithArray"
) )
default ResponseEntity<Void> createUsersWithArrayInput( default ResponseEntity<Void> createUsersWithArrayInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -84,18 +92,22 @@ public interface UserApi {
* @param body List of user object (required) * @param body List of user object (required)
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Creates list of users with given input array", nickname = "createUsersWithListInput", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Creates list of users with given input array",
nickname = "createUsersWithListInput",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.POST, method = RequestMethod.POST,
value = "/user/createWithList" value = "/user/createWithList"
) )
default ResponseEntity<Void> createUsersWithListInput( default ResponseEntity<Void> createUsersWithListInput(
@ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<User> body
@ApiParam(value = "List of user object", required = true ) @Valid @RequestBody List<User> body) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -109,20 +121,23 @@ public interface UserApi {
* @return Invalid username supplied (status code 400) * @return Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Delete user", nickname = "deleteUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Delete user",
nickname = "deleteUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.DELETE, method = RequestMethod.DELETE,
value = "/user/{username}" value = "/user/{username}"
) )
default ResponseEntity<Void> deleteUser(@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username default ResponseEntity<Void> deleteUser(
@ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
) { ) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -136,23 +151,26 @@ public interface UserApi {
* or Invalid username supplied (status code 400) * or Invalid username supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Get user by user name", nickname = "getUserByName", notes = "", response = User.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Get user by user name",
nickname = "getUserByName",
notes = "",
response = User.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = User.class), @ApiResponse(code = 200, message = "successful operation", response = User.class),
@ApiResponse(code = 400, message = "Invalid username supplied"), @ApiResponse(code = 400, message = "Invalid username supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/{username}", value = "/user/{username}",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<User> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username default ResponseEntity<User> getUserByName(
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
) { ) {
getRequest().ifPresent(request -> { getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
@@ -180,23 +198,26 @@ public interface UserApi {
* @return successful operation (status code 200) * @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400) * or Invalid username/password supplied (status code 400)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs user into the system", nickname = "loginUser", notes = "", response = String.class, tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs user into the system",
nickname = "loginUser",
notes = "",
response = String.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 200, message = "successful operation", response = String.class),
@ApiResponse(code = 400, message = "Invalid username/password supplied")
@ApiResponse(code = 400, message = "Invalid username/password supplied") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/login", value = "/user/login",
produces = "application/json" produces = "application/json"
) )
default ResponseEntity<String> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username default ResponseEntity<String> loginUser(
@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
) {
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -207,16 +228,22 @@ public interface UserApi {
* *
* @return successful operation (status code 200) * @return successful operation (status code 200)
*/ */
@ApiOperation(
@ApiOperation(value = "Logs out current logged in user session", nickname = "logoutUser", notes = "", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Logs out current logged in user session",
nickname = "logoutUser",
@ApiResponse(code = 200, message = "successful operation") }) notes = ""
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation")
})
@RequestMapping( @RequestMapping(
method = RequestMethod.GET, method = RequestMethod.GET,
value = "/user/logout" value = "/user/logout"
) )
default ResponseEntity<Void> logoutUser() { default ResponseEntity<Void> logoutUser(
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
@@ -231,22 +258,24 @@ public interface UserApi {
* @return Invalid user supplied (status code 400) * @return Invalid user supplied (status code 400)
* or User not found (status code 404) * or User not found (status code 404)
*/ */
@ApiOperation(
@ApiOperation(value = "Updated user", nickname = "updateUser", notes = "This can only be done by the logged in user.", tags={ "user", }) tags = { "user" },
@ApiResponses(value = { value = "Updated user",
nickname = "updateUser",
notes = "This can only be done by the logged in user."
)
@ApiResponses({
@ApiResponse(code = 400, message = "Invalid user supplied"), @ApiResponse(code = 400, message = "Invalid user supplied"),
@ApiResponse(code = 404, message = "User not found")
@ApiResponse(code = 404, message = "User not found") }) })
@RequestMapping( @RequestMapping(
method = RequestMethod.PUT, method = RequestMethod.PUT,
value = "/user/{username}" value = "/user/{username}"
) )
default ResponseEntity<Void> updateUser(@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username default ResponseEntity<Void> updateUser(
@ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
) {
@ApiParam(value = "Updated user object", required = true ) @Valid @RequestBody User body) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,16 @@
README.md
pom.xml
src/main/java/org/openapitools/api/PetApi.java
src/main/java/org/openapitools/api/PetApiClient.java
src/main/java/org/openapitools/api/StoreApi.java
src/main/java/org/openapitools/api/StoreApiClient.java
src/main/java/org/openapitools/api/UserApi.java
src/main/java/org/openapitools/api/UserApiClient.java
src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java
src/main/java/org/openapitools/configuration/ClientConfiguration.java
src/main/java/org/openapitools/model/Category.java
src/main/java/org/openapitools/model/ModelApiResponse.java
src/main/java/org/openapitools/model/Order.java
src/main/java/org/openapitools/model/Pet.java
src/main/java/org/openapitools/model/Tag.java
src/main/java/org/openapitools/model/User.java

View File

@@ -0,0 +1 @@
5.4.0-SNAPSHOT

View File

@@ -0,0 +1,53 @@
# petstore-spring-cloud
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation
To install the API client library to your local Maven repository, simply execute:
```shell
mvn install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn deploy
```
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
### Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>org.openapitools.openapi3</groupId>
<artifactId>petstore-spring-cloud</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```
### Gradle users
Add this dependency to your project's build file:
```groovy
compile "org.openapitools.openapi3:petstore-spring-cloud:1.0.0"
```
### Others
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
* target/petstore-spring-cloud-1.0.0.jar
* target/lib/*.jar

View File

@@ -0,0 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools.openapi3</groupId>
<artifactId>petstore-spring-cloud</artifactId>
<packaging>jar</packaging>
<name>petstore-spring-cloud</name>
<version>1.0.0</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>2.1.11</swagger-core-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2021.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,270 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Pet", description = "the Pet API")
public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
* @param body Pet object that needs to be added to the store (required)
* @return Invalid input (status code 405)
*/
@Operation(
summary = "Add a new pet to the store",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "405", description = "Invalid input")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet",
consumes = "application/json"
)
CompletableFuture<ResponseEntity<Void>> addPet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return Invalid pet value (status code 400)
*/
@Operation(
summary = "Deletes a pet",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid pet value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/pet/{petId}"
)
CompletableFuture<ResponseEntity<Void>> deletePet(
@Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey
);
/**
* GET /pet/findByStatus : Finds Pets by status
* Multiple status values can be provided with comma separated strings
*
* @param status Status values that need to be considered for filter (required)
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
@Operation(
summary = "Finds Pets by status",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid status value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByStatus",
produces = "application/json"
)
CompletableFuture<ResponseEntity<List<Pet>>> findPetsByStatus(
@NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List<String> status
);
/**
* GET /pet/findByTags : Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* @param tags Tags to filter by (required)
* @return successful operation (status code 200)
* or Invalid tag value (status code 400)
* @deprecated
*/
@Operation(
summary = "Finds Pets by tags",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid tag value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByTags",
produces = "application/json"
)
CompletableFuture<ResponseEntity<List<Pet>>> findPetsByTags(
@NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) List<String> tags
);
/**
* GET /pet/{petId} : Find pet by ID
* Returns a single pet
*
* @param petId ID of pet to return (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
@Operation(
summary = "Find pet by ID",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Pet not found")
},
security = {
@SecurityRequirement(name = "api_key")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/{petId}",
produces = "application/json"
)
CompletableFuture<ResponseEntity<Pet>> getPetById(
@Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId
);
/**
* PUT /pet : Update an existing pet
*
* @param body Pet object that needs to be added to the store (required)
* @return Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
* or Validation exception (status code 405)
*/
@Operation(
summary = "Update an existing pet",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Pet not found"),
@ApiResponse(responseCode = "405", description = "Validation exception")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/pet",
consumes = "application/json"
)
CompletableFuture<ResponseEntity<Void>> updatePet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
@Operation(
summary = "Updates a pet in the store with form data",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "405", description = "Invalid input")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded"
)
CompletableFuture<ResponseEntity<Void>> updatePetWithForm(
@Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name,
@Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status
);
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
@Operation(
summary = "uploads an image",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)))
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage",
produces = "application/json",
consumes = "multipart/form-data"
)
CompletableFuture<ResponseEntity<ModelApiResponse>> uploadFile(
@Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,
@Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file
);
}

View File

@@ -0,0 +1,8 @@
package org.openapitools.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.openapitools.configuration.ClientConfiguration;
@FeignClient(name="${pet.name:pet}", url="${pet.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
public interface PetApiClient extends PetApi {
}

View File

@@ -0,0 +1,140 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.util.Map;
import org.openapitools.model.Order;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Store", description = "the Store API")
public interface StoreApi {
/**
* DELETE /store/order/{orderId} : Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
* @param orderId ID of the order that needs to be deleted (required)
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
@Operation(
summary = "Delete purchase order by ID",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Order not found")
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/store/order/{orderId}"
)
CompletableFuture<ResponseEntity<Void>> deleteOrder(
@Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("orderId") String orderId
);
/**
* GET /store/inventory : Returns pet inventories by status
* Returns a map of status codes to quantities
*
* @return successful operation (status code 200)
*/
@Operation(
summary = "Returns pet inventories by status",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)))
},
security = {
@SecurityRequirement(name = "api_key")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/store/inventory",
produces = "application/json"
)
CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory(
);
/**
* GET /store/order/{orderId} : Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* @param orderId ID of pet that needs to be fetched (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
@Operation(
summary = "Find purchase order by ID",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Order not found")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/store/order/{orderId}",
produces = "application/json"
)
CompletableFuture<ResponseEntity<Order>> getOrderById(
@Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("orderId") Long orderId
);
/**
* POST /store/order : Place an order for a pet
*
* @param body order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@Operation(
summary = "Place an order for a pet",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))),
@ApiResponse(responseCode = "400", description = "Invalid Order")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/store/order",
produces = "application/json"
)
CompletableFuture<ResponseEntity<Order>> placeOrder(
@Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body
);
}

View File

@@ -0,0 +1,8 @@
package org.openapitools.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.openapitools.configuration.ClientConfiguration;
@FeignClient(name="${store.name:store}", url="${store.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
public interface StoreApiClient extends StoreApi {
}

View File

@@ -0,0 +1,231 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.util.List;
import java.time.OffsetDateTime;
import org.openapitools.model.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "User", description = "the User API")
public interface UserApi {
/**
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Create user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user"
)
CompletableFuture<ResponseEntity<Void>> createUser(
@Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Creates list of users with given input array",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithArray"
)
CompletableFuture<ResponseEntity<Void>> createUsersWithArrayInput(
@Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List<User> body
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Creates list of users with given input array",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithList"
)
CompletableFuture<ResponseEntity<Void>> createUsersWithListInput(
@Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List<User> body
);
/**
* DELETE /user/{username} : Delete user
* This can only be done by the logged in user.
*
* @param username The name that needs to be deleted (required)
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Delete user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/user/{username}"
)
CompletableFuture<ResponseEntity<Void>> deleteUser(
@Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username
);
/**
* GET /user/{username} : Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Get user by user name",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))),
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/{username}",
produces = "application/json"
)
CompletableFuture<ResponseEntity<User>> getUserByName(
@Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username
);
/**
* GET /user/login : Logs user into the system
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
@Operation(
summary = "Logs user into the system",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/login",
produces = "application/json"
)
CompletableFuture<ResponseEntity<String>> loginUser(
@NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username,
@NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password
);
/**
* GET /user/logout : Logs out current logged in user session
*
* @return successful operation (status code 200)
*/
@Operation(
summary = "Logs out current logged in user session",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/logout"
)
CompletableFuture<ResponseEntity<Void>> logoutUser(
);
/**
* PUT /user/{username} : Updated user
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Updated user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid user supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/user/{username}"
)
CompletableFuture<ResponseEntity<Void>> updateUser(
@Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username,
@Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body
);
}

View File

@@ -0,0 +1,8 @@
package org.openapitools.api;
import org.springframework.cloud.openfeign.FeignClient;
import org.openapitools.configuration.ClientConfiguration;
@FeignClient(name="${user.name:user}", url="${user.url:http://petstore.swagger.io/v2}", configuration = ClientConfiguration.class)
public interface UserApiClient extends UserApi {
}

View File

@@ -0,0 +1,31 @@
package org.openapitools.configuration;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import feign.Util;
public class ApiKeyRequestInterceptor implements RequestInterceptor {
private final String location;
private final String name;
private String value;
public ApiKeyRequestInterceptor(String location, String name, String value) {
Util.checkNotNull(location, "location", new Object[0]);
Util.checkNotNull(name, "name", new Object[0]);
Util.checkNotNull(value, "value", new Object[0]);
this.location = location;
this.name = name;
this.value = value;
}
@Override
public void apply(RequestTemplate requestTemplate) {
if(location.equals("header")) {
requestTemplate.header(name, value);
} else if(location.equals("query")) {
requestTemplate.query(name, value);
}
}
}

View File

@@ -0,0 +1,48 @@
package org.openapitools.configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.cloud.openfeign.security.OAuth2FeignRequestInterceptor;
import org.springframework.security.oauth2.client.DefaultOAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2ClientContext;
import org.springframework.security.oauth2.client.token.grant.implicit.ImplicitResourceDetails;
@Configuration
@EnableConfigurationProperties
public class ClientConfiguration {
@Value("${openapipetstore.security.apiKey.key:}")
private String apiKeyKey;
@Bean
@ConditionalOnProperty(name = "openapipetstore.security.apiKey.key")
public ApiKeyRequestInterceptor apiKeyRequestInterceptor() {
return new ApiKeyRequestInterceptor("header", "api_key", this.apiKeyKey);
}
@Bean
@ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id")
public OAuth2FeignRequestInterceptor petstoreAuthRequestInterceptor(OAuth2ClientContext oAuth2ClientContext) {
return new OAuth2FeignRequestInterceptor(oAuth2ClientContext, petstoreAuthResourceDetails());
}
@Bean
@ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id")
public OAuth2ClientContext oAuth2ClientContext() {
return new DefaultOAuth2ClientContext();
}
@Bean
@ConditionalOnProperty("openapipetstore.security.petstoreAuth.client-id")
@ConfigurationProperties("openapipetstore.security.petstoreAuth")
public ImplicitResourceDetails petstoreAuthResourceDetails() {
ImplicitResourceDetails details = new ImplicitResourceDetails();
details.setUserAuthorizationUri("http://petstore.swagger.io/api/oauth/dialog");
return details;
}
}

View File

@@ -0,0 +1,109 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* A category for a pet
*/
@Schema(name = "Category",description = "A category for a pet")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class Category {
@JsonProperty("id")
private Long id;
@JsonProperty("name")
private String name;
public Category id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@Schema(name = "id", defaultValue = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Category name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Category category = (Category) o;
return Objects.equals(this.id, category.id) &&
Objects.equals(this.name, category.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,134 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* Describes the result of uploading an image resource
*/
@Schema(name = "ApiResponse",description = "Describes the result of uploading an image resource")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ModelApiResponse {
@JsonProperty("code")
private Integer code;
@JsonProperty("type")
private String type;
@JsonProperty("message")
private String message;
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/**
* Get code
* @return code
*/
@Schema(name = "code", defaultValue = "")
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
*/
@Schema(name = "type", defaultValue = "")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
/**
* Get message
* @return message
*/
@Schema(name = "message", defaultValue = "")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.code, _apiResponse.code) &&
Objects.equals(this.type, _apiResponse.type) &&
Objects.equals(this.message, _apiResponse.message);
}
@Override
public int hashCode() {
return Objects.hash(code, type, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,250 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.time.OffsetDateTime;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* An order for a pets from the pet store
*/
@Schema(name = "Order",description = "An order for a pets from the pet store")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class Order {
@JsonProperty("id")
private Long id;
@JsonProperty("petId")
private Long petId;
@JsonProperty("quantity")
private Integer quantity;
@JsonProperty("shipDate")
@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)
private OffsetDateTime shipDate;
/**
* Order Status
*/
public enum StatusEnum {
PLACED("placed"),
APPROVED("approved"),
DELIVERED("delivered");
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
@JsonProperty("status")
private StatusEnum status;
@JsonProperty("complete")
private Boolean complete = false;
public Order id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@Schema(name = "id", defaultValue = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/**
* Get petId
* @return petId
*/
@Schema(name = "petId", defaultValue = "")
public Long getPetId() {
return petId;
}
public void setPetId(Long petId) {
this.petId = petId;
}
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/**
* Get quantity
* @return quantity
*/
@Schema(name = "quantity", defaultValue = "")
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
return this;
}
/**
* Get shipDate
* @return shipDate
*/
@Schema(name = "shipDate", defaultValue = "")
@Valid
public OffsetDateTime getShipDate() {
return shipDate;
}
public void setShipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
}
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Order Status
* @return status
*/
@Schema(name = "status", defaultValue = "Order Status")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
/**
* Get complete
* @return complete
*/
@Schema(name = "complete", defaultValue = "")
public Boolean getComplete() {
return complete;
}
public void setComplete(Boolean complete) {
this.complete = complete;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Order order = (Order) o;
return Objects.equals(this.id, order.id) &&
Objects.equals(this.petId, order.petId) &&
Objects.equals(this.quantity, order.quantity) &&
Objects.equals(this.shipDate, order.shipDate) &&
Objects.equals(this.status, order.status) &&
Objects.equals(this.complete, order.complete);
}
@Override
public int hashCode() {
return Objects.hash(id, petId, quantity, shipDate, status, complete);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,270 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.model.Category;
import org.openapitools.model.Tag;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* A pet for sale in the pet store
*/
@Schema(name = "Pet",description = "A pet for sale in the pet store")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class Pet {
@JsonProperty("id")
private Long id;
@JsonProperty("category")
private Category category;
@JsonProperty("name")
private String name;
@JsonProperty("photoUrls")
@Valid
private List<String> photoUrls = new ArrayList<>();
@JsonProperty("tags")
@Valid
private List<Tag> tags = null;
/**
* pet status in the store
*/
public enum StatusEnum {
AVAILABLE("available"),
PENDING("pending"),
SOLD("sold");
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
@JsonProperty("status")
private StatusEnum status;
public Pet id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@Schema(name = "id", defaultValue = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Pet category(Category category) {
this.category = category;
return this;
}
/**
* Get category
* @return category
*/
@Schema(name = "category", defaultValue = "")
@Valid
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public Pet name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", example = "doggie", required = true, defaultValue = "")
@NotNull
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
return this;
}
/**
* Get photoUrls
* @return photoUrls
*/
@Schema(name = "photoUrls", required = true, defaultValue = "")
@NotNull
public List<String> getPhotoUrls() {
return photoUrls;
}
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
public Pet addTagsItem(Tag tagsItem) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(tagsItem);
return this;
}
/**
* Get tags
* @return tags
*/
@Schema(name = "tags", defaultValue = "")
@Valid
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/**
* pet status in the store
* @return status
*/
@Schema(name = "status", defaultValue = "pet status in the store")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Pet pet = (Pet) o;
return Objects.equals(this.id, pet.id) &&
Objects.equals(this.category, pet.category) &&
Objects.equals(this.name, pet.name) &&
Objects.equals(this.photoUrls, pet.photoUrls) &&
Objects.equals(this.tags, pet.tags) &&
Objects.equals(this.status, pet.status);
}
@Override
public int hashCode() {
return Objects.hash(id, category, name, photoUrls, tags, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,109 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* A tag for a pet
*/
@Schema(name = "Tag",description = "A tag for a pet")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class Tag {
@JsonProperty("id")
private Long id;
@JsonProperty("name")
private String name;
public Tag id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@Schema(name = "id", defaultValue = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Tag name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Tag tag = (Tag) o;
return Objects.equals(this.id, tag.id) &&
Objects.equals(this.name, tag.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Tag {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,259 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* A User who is purchasing from the pet store
*/
@Schema(name = "User",description = "A User who is purchasing from the pet store")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class User {
@JsonProperty("id")
private Long id;
@JsonProperty("username")
private String username;
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("email")
private String email;
@JsonProperty("password")
private String password;
@JsonProperty("phone")
private String phone;
@JsonProperty("userStatus")
private Integer userStatus;
public User id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
*/
@Schema(name = "id", defaultValue = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User username(String username) {
this.username = username;
return this;
}
/**
* Get username
* @return username
*/
@Schema(name = "username", defaultValue = "")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get firstName
* @return firstName
*/
@Schema(name = "firstName", defaultValue = "")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get lastName
* @return lastName
*/
@Schema(name = "lastName", defaultValue = "")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public User email(String email) {
this.email = email;
return this;
}
/**
* Get email
* @return email
*/
@Schema(name = "email", defaultValue = "")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public User password(String password) {
this.password = password;
return this;
}
/**
* Get password
* @return password
*/
@Schema(name = "password", defaultValue = "")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public User phone(String phone) {
this.phone = phone;
return this;
}
/**
* Get phone
* @return phone
*/
@Schema(name = "phone", defaultValue = "")
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
/**
* User Status
* @return userStatus
*/
@Schema(name = "userStatus", defaultValue = "User Status")
public Integer getUserStatus() {
return userStatus;
}
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
User user = (User) o;
return Objects.equals(this.id, user.id) &&
Objects.equals(this.username, user.username) &&
Objects.equals(this.firstName, user.firstName) &&
Objects.equals(this.lastName, user.lastName) &&
Objects.equals(this.email, user.email) &&
Objects.equals(this.password, user.password) &&
Objects.equals(this.phone, user.phone) &&
Objects.equals(this.userStatus, user.userStatus);
}
@Override
public int hashCode() {
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,3 @@
README.md
pom.xml
src/main/java/org/openapitools/api/DefaultApi.java

View File

@@ -0,0 +1 @@
5.4.0-SNAPSHOT

View File

@@ -0,0 +1,26 @@
# OpenAPI generated API stub
Spring Framework stub
## Overview
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
This is an example of building API stub interfaces in Java using the Spring framework.
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
by adding ```@Controller``` classes that implement the interface. Eg:
```java
@Controller
public class PetController implements PetApi {
// implement all PetApi methods
}
```
You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg:
```java
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
public interface PetClient extends PetApi {
}
```

View File

@@ -0,0 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools.openapi3</groupId>
<artifactId>spring-cloud-date-time-oas3</artifactId>
<packaging>jar</packaging>
<name>spring-cloud-date-time-oas3</name>
<version>1.0</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>2.1.11</swagger-core-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2021.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,89 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Default", description = "the Default API")
public interface DefaultApi {
/**
* GET /thingy/{date}
*
* @param date A date path parameter (required)
* @param dateTime A date-time query parameter (required)
* @param xOrderDate A date header parameter (required)
* @param loginDate A date cookie parameter (optional)
* @return OK (status code 200)
*/
@Operation(
summary = "",
tags = { },
responses = {
@ApiResponse(responseCode = "200", description = "OK")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/thingy/{date}"
)
ResponseEntity<Void> get(
@Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date,
@NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "dateTime", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
@Parameter(name = "X-Order-Date", description = "A date header parameter", required = true, schema = @Schema(description = "")) @RequestHeader(value = "X-Order-Date", required = true) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate xOrderDate,
@Parameter(name = "loginDate", description = "A date cookie parameter", schema = @Schema(description = "")) @CookieValue("loginDate") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate loginDate
);
/**
* POST /thingy/{date}
* update with form data
*
* @param date A date path parameter (required)
* @param visitDate Updated last vist timestamp (optional)
* @return Invalid input (status code 405)
*/
@Operation(
summary = "",
tags = { },
responses = {
@ApiResponse(responseCode = "405", description = "Invalid input")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/thingy/{date}",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> updatePetWithForm(
@Parameter(name = "date", description = "A date path parameter", required = true, schema = @Schema(description = "")) @PathVariable("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date,
@Parameter(name = "visitDate", description = "Updated last vist timestamp", schema = @Schema(description = "")) @RequestParam(value="visitDate", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate
);
}

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,54 @@
README.md
pom.xml
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/FakeApi.java
src/main/java/org/openapitools/api/FakeClassnameTags123Api.java
src/main/java/org/openapitools/api/PetApi.java
src/main/java/org/openapitools/api/StoreApi.java
src/main/java/org/openapitools/api/UserApi.java
src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
src/main/java/org/openapitools/model/AdditionalPropertiesString.java
src/main/java/org/openapitools/model/Animal.java
src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
src/main/java/org/openapitools/model/ArrayTest.java
src/main/java/org/openapitools/model/BigCat.java
src/main/java/org/openapitools/model/BigCatAllOf.java
src/main/java/org/openapitools/model/Capitalization.java
src/main/java/org/openapitools/model/Cat.java
src/main/java/org/openapitools/model/CatAllOf.java
src/main/java/org/openapitools/model/Category.java
src/main/java/org/openapitools/model/ClassModel.java
src/main/java/org/openapitools/model/Client.java
src/main/java/org/openapitools/model/Dog.java
src/main/java/org/openapitools/model/DogAllOf.java
src/main/java/org/openapitools/model/EnumArrays.java
src/main/java/org/openapitools/model/EnumClass.java
src/main/java/org/openapitools/model/EnumTest.java
src/main/java/org/openapitools/model/FileSchemaTestClass.java
src/main/java/org/openapitools/model/FormatTest.java
src/main/java/org/openapitools/model/HasOnlyReadOnly.java
src/main/java/org/openapitools/model/MapTest.java
src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/main/java/org/openapitools/model/Model200Response.java
src/main/java/org/openapitools/model/ModelApiResponse.java
src/main/java/org/openapitools/model/ModelReturn.java
src/main/java/org/openapitools/model/Name.java
src/main/java/org/openapitools/model/NumberOnly.java
src/main/java/org/openapitools/model/Order.java
src/main/java/org/openapitools/model/OuterComposite.java
src/main/java/org/openapitools/model/OuterEnum.java
src/main/java/org/openapitools/model/Pet.java
src/main/java/org/openapitools/model/ReadOnlyFirst.java
src/main/java/org/openapitools/model/SpecialModelName.java
src/main/java/org/openapitools/model/Tag.java
src/main/java/org/openapitools/model/TypeHolderDefault.java
src/main/java/org/openapitools/model/TypeHolderExample.java
src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java

View File

@@ -0,0 +1,26 @@
# OpenAPI generated API stub
Spring Framework stub
## Overview
This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub.
This is an example of building API stub interfaces in Java using the Spring framework.
The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints
by adding ```@Controller``` classes that implement the interface. Eg:
```java
@Controller
public class PetController implements PetApi {
// implement all PetApi methods
}
```
You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg:
```java
@FeignClient(name="pet", url="http://petstore.swagger.io/v2")
public interface PetClient extends PetApi {
}
```

View File

@@ -0,0 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools.openapi3</groupId>
<artifactId>spring-cloud-oas3</artifactId>
<packaging>jar</packaging>
<name>spring-cloud-oas3</name>
<version>1.0.0</version>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>2.1.11</swagger-core-version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>2021.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core-version}</version>
</dependency>
<!-- @Nullable annotation -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
<version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,59 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import org.openapitools.model.Client;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "AnotherFake", description = "the AnotherFake API")
public interface AnotherFakeApi {
/**
* PATCH /another-fake/dummy : To test special tags
* To test special tags and operation ID starting with number
*
* @param body client model (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "To test special tags",
tags = { "$another-fake?" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)))
}
)
@RequestMapping(
method = RequestMethod.PATCH,
value = "/another-fake/dummy",
produces = "application/json",
consumes = "application/json"
)
ResponseEntity<Client> call123testSpecialTags(
@Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body
);
}

View File

@@ -0,0 +1,443 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.math.BigDecimal;
import org.openapitools.model.Client;
import org.openapitools.model.FileSchemaTestClass;
import java.time.LocalDate;
import java.util.Map;
import java.time.OffsetDateTime;
import org.openapitools.model.OuterComposite;
import org.openapitools.model.User;
import org.openapitools.model.XmlItem;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Fake", description = "the Fake API")
public interface FakeApi {
/**
* POST /fake/create_xml_item : creates an XmlItem
* this route creates an XmlItem
*
* @param xmlItem XmlItem Body (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "creates an XmlItem",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/create_xml_item",
consumes = "application/xml"
)
ResponseEntity<Void> createXmlItem(
@Parameter(name = "XmlItem", description = "XmlItem Body", required = true, schema = @Schema(description = "")) @Valid @RequestBody XmlItem xmlItem
);
/**
* POST /fake/outer/boolean
* Test serialization of outer boolean types
*
* @param body Input boolean as post body (optional)
* @return Output boolean (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Output boolean", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class)))
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/boolean",
produces = "*/*"
)
ResponseEntity<Boolean> fakeOuterBooleanSerialize(
@Parameter(name = "body", description = "Input boolean as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) Boolean body
);
/**
* POST /fake/outer/composite
* Test serialization of object with outer number type
*
* @param body Input composite as post body (optional)
* @return Output composite (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Output composite", content = @Content(mediaType = "application/json", schema = @Schema(implementation = OuterComposite.class)))
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/composite",
produces = "*/*"
)
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(
@Parameter(name = "body", description = "Input composite as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) OuterComposite body
);
/**
* POST /fake/outer/number
* Test serialization of outer number types
*
* @param body Input number as post body (optional)
* @return Output number (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Output number", content = @Content(mediaType = "application/json", schema = @Schema(implementation = BigDecimal.class)))
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/number",
produces = "*/*"
)
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
@Parameter(name = "body", description = "Input number as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) BigDecimal body
);
/**
* POST /fake/outer/string
* Test serialization of outer string types
*
* @param body Input string as post body (optional)
* @return Output string (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Output string", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)))
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/string",
produces = "*/*"
)
ResponseEntity<String> fakeOuterStringSerialize(
@Parameter(name = "body", description = "Input string as post body", schema = @Schema(description = "")) @Valid @RequestBody(required = false) String body
);
/**
* PUT /fake/body-with-file-schema
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param body (required)
* @return Success (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Success")
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/body-with-file-schema",
consumes = "application/json"
)
ResponseEntity<Void> testBodyWithFileSchema(
@Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody FileSchemaTestClass body
);
/**
* PUT /fake/body-with-query-params
*
* @param query (required)
* @param body (required)
* @return Success (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Success")
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/body-with-query-params",
consumes = "application/json"
)
ResponseEntity<Void> testBodyWithQueryParams(
@NotNull @Parameter(name = "query", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "query", required = true) String query,
@Parameter(name = "body", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body
);
/**
* PATCH /fake : To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "To test \"client\" model",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)))
}
)
@RequestMapping(
method = RequestMethod.PATCH,
value = "/fake",
produces = "application/json",
consumes = "application/json"
)
ResponseEntity<Client> testClientModel(
@Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body
);
/**
* POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* @param number None (required)
* @param _double None (required)
* @param patternWithoutDelimiter None (required)
* @param _byte None (required)
* @param integer None (optional)
* @param int32 None (optional)
* @param int64 None (optional)
* @param _float None (optional)
* @param string None (optional)
* @param binary None (optional)
* @param date None (optional)
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
},
security = {
@SecurityRequirement(name = "http_basic_test")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> testEndpointParameters(
@Parameter(name = "number", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="number", required=true) BigDecimal number,
@Parameter(name = "double", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="double", required=true) Double _double,
@Parameter(name = "pattern_without_delimiter", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,
@Parameter(name = "byte", description = "None", required = true, schema = @Schema(description = "")) @RequestParam(value="byte", required=true) byte[] _byte,
@Parameter(name = "integer", description = "None", schema = @Schema(description = "")) @RequestParam(value="integer", required=false) Integer integer,
@Parameter(name = "int32", description = "None", schema = @Schema(description = "")) @RequestParam(value="int32", required=false) Integer int32,
@Parameter(name = "int64", description = "None", schema = @Schema(description = "")) @RequestParam(value="int64", required=false) Long int64,
@Parameter(name = "float", description = "None", schema = @Schema(description = "")) @RequestParam(value="float", required=false) Float _float,
@Parameter(name = "string", description = "None", schema = @Schema(description = "")) @RequestParam(value="string", required=false) String string,
@Parameter(name = "binary", description = "None", schema = @Schema(description = "")) @RequestParam("binary") MultipartFile binary,
@Parameter(name = "date", description = "None", schema = @Schema(description = "")) @RequestParam(value="date", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) LocalDate date,
@Parameter(name = "dateTime", description = "None", schema = @Schema(description = "")) @RequestParam(value="dateTime", required=false) @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
@Parameter(name = "password", description = "None", schema = @Schema(description = "")) @RequestParam(value="password", required=false) String password,
@Parameter(name = "callback", description = "None", schema = @Schema(description = "")) @RequestParam(value="callback", required=false) String paramCallback
);
/**
* GET /fake : To test enum parameters
* To test enum parameters
*
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @return Invalid request (status code 400)
* or Not found (status code 404)
*/
@Operation(
summary = "To test enum parameters",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid request"),
@ApiResponse(responseCode = "404", description = "Not found")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/fake",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> testEnumParameters(
@Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestHeader(value = "enum_header_string_array", required = false) List<String> enumHeaderStringArray,
@Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestHeader(value = "enum_header_string", required = false) String enumHeaderString,
@Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @Valid @RequestParam(value = "enum_query_string_array", required = false) List<String> enumQueryStringArray,
@Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
@Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1", "-2" })) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
@Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", schema = @Schema(description = "", allowableValues = { "1.1", "-1.2" })) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,
@Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)", schema = @Schema(description = "", allowableValues = { ">", "$" })) @RequestParam(value="enum_form_string_array", required=false) List<String> enumFormStringArray,
@Parameter(name = "enum_form_string", description = "Form parameter enum test (string)", schema = @Schema(description = "", allowableValues = { "_abc", "-efg", "(xyz)" }, defaultValue = "-efg")) @RequestParam(value="enum_form_string", required=false) String enumFormString
);
/**
* DELETE /fake : Fake endpoint to test group parameters (optional)
* Fake endpoint to test group parameters (optional)
*
* @param requiredStringGroup Required String in group parameters (required)
* @param requiredBooleanGroup Required Boolean in group parameters (required)
* @param requiredInt64Group Required Integer in group parameters (required)
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @return Someting wrong (status code 400)
*/
@Operation(
summary = "Fake endpoint to test group parameters (optional)",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "400", description = "Someting wrong")
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/fake"
)
ResponseEntity<Void> testGroupParameters(
@NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,
@Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, schema = @Schema(description = "")) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,
@NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,
@Parameter(name = "string_group", description = "String in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,
@Parameter(name = "boolean_group", description = "Boolean in group parameters", schema = @Schema(description = "")) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,
@Parameter(name = "int64_group", description = "Integer in group parameters", schema = @Schema(description = "")) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group
);
/**
* POST /fake/inline-additionalProperties : test inline additionalProperties
*
* @param param request body (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "test inline additionalProperties",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/inline-additionalProperties",
consumes = "application/json"
)
ResponseEntity<Void> testInlineAdditionalProperties(
@Parameter(name = "param", description = "request body", required = true, schema = @Schema(description = "")) @Valid @RequestBody Map<String, String> param
);
/**
* GET /fake/jsonFormData : test json serialization of form data
*
* @param param field1 (required)
* @param param2 field2 (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "test json serialization of form data",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/fake/jsonFormData",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> testJsonFormData(
@Parameter(name = "param", description = "field1", required = true, schema = @Schema(description = "")) @RequestParam(value="param", required=true) String param,
@Parameter(name = "param2", description = "field2", required = true, schema = @Schema(description = "")) @RequestParam(value="param2", required=true) String param2
);
/**
* PUT /fake/test-query-parameters
* To test the collection format in query parameters
*
* @param pipe (required)
* @param ioutil (required)
* @param http (required)
* @param url (required)
* @param context (required)
* @return Success (status code 200)
*/
@Operation(
summary = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "Success")
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/fake/test-query-parameters"
)
ResponseEntity<Void> testQueryParameterCollectionFormat(
@NotNull @Parameter(name = "pipe", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,
@NotNull @Parameter(name = "ioutil", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,
@NotNull @Parameter(name = "http", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "http", required = true) List<String> http,
@NotNull @Parameter(name = "url", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "url", required = true) List<String> url,
@NotNull @Parameter(name = "context", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "context", required = true) List<String> context
);
}

View File

@@ -0,0 +1,62 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import org.openapitools.model.Client;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "FakeClassnameTags123", description = "the FakeClassnameTags123 API")
public interface FakeClassnameTags123Api {
/**
* PATCH /fake_classname_test : To test class name in snake case
* To test class name in snake case
*
* @param body client model (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "To test class name in snake case",
tags = { "fake_classname_tags 123#$%^" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)))
},
security = {
@SecurityRequirement(name = "api_key_query")
}
)
@RequestMapping(
method = RequestMethod.PATCH,
value = "/fake_classname_test",
produces = "application/json",
consumes = "application/json"
)
ResponseEntity<Client> testClassname(
@Parameter(name = "body", description = "client model", required = true, schema = @Schema(description = "")) @Valid @RequestBody Client body
);
}

View File

@@ -0,0 +1,307 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
import java.util.Set;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Pet", description = "the Pet API")
public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
* @param body Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
@Operation(
summary = "Add a new pet to the store",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ApiResponse(responseCode = "405", description = "Invalid input")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet",
consumes = "application/json"
)
ResponseEntity<Void> addPet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
* @return successful operation (status code 200)
* or Invalid pet value (status code 400)
*/
@Operation(
summary = "Deletes a pet",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ApiResponse(responseCode = "400", description = "Invalid pet value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/pet/{petId}"
)
ResponseEntity<Void> deletePet(
@Parameter(name = "petId", description = "Pet id to delete", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "api_key", description = "", schema = @Schema(description = "")) @RequestHeader(value = "api_key", required = false) String apiKey
);
/**
* GET /pet/findByStatus : Finds Pets by status
* Multiple status values can be provided with comma separated strings
*
* @param status Status values that need to be considered for filter (required)
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
@Operation(
summary = "Finds Pets by status",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid status value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByStatus",
produces = "application/json"
)
ResponseEntity<List<Pet>> findPetsByStatus(
@NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List<String> status
);
/**
* GET /pet/findByTags : Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
* @param tags Tags to filter by (required)
* @return successful operation (status code 200)
* or Invalid tag value (status code 400)
* @deprecated
*/
@Operation(
summary = "Finds Pets by tags",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid tag value")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByTags",
produces = "application/json"
)
ResponseEntity<Set<Pet>> findPetsByTags(
@NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "tags", required = true) Set<String> tags
);
/**
* GET /pet/{petId} : Find pet by ID
* Returns a single pet
*
* @param petId ID of pet to return (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
@Operation(
summary = "Find pet by ID",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Pet not found")
},
security = {
@SecurityRequirement(name = "api_key")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/{petId}",
produces = "application/json"
)
ResponseEntity<Pet> getPetById(
@Parameter(name = "petId", description = "ID of pet to return", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId
);
/**
* PUT /pet : Update an existing pet
*
* @param body Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
* or Validation exception (status code 405)
*/
@Operation(
summary = "Update an existing pet",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Pet not found"),
@ApiResponse(responseCode = "405", description = "Validation exception")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/pet",
consumes = "application/json"
)
ResponseEntity<Void> updatePet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true, schema = @Schema(description = "")) @Valid @RequestBody Pet body
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
@Operation(
summary = "Updates a pet in the store with form data",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "405", description = "Invalid input")
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}",
consumes = "application/x-www-form-urlencoded"
)
ResponseEntity<Void> updatePetWithForm(
@Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "name", description = "Updated name of the pet", schema = @Schema(description = "")) @RequestParam(value="name", required=false) String name,
@Parameter(name = "status", description = "Updated status of the pet", schema = @Schema(description = "")) @RequestParam(value="status", required=false) String status
);
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
@Operation(
summary = "uploads an image",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)))
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage",
produces = "application/json",
consumes = "multipart/form-data"
)
ResponseEntity<ModelApiResponse> uploadFile(
@Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,
@Parameter(name = "file", description = "file to upload", schema = @Schema(description = "")) @RequestParam("file") MultipartFile file
);
/**
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
*
* @param petId ID of pet to update (required)
* @param requiredFile file to upload (required)
* @param additionalMetadata Additional data to pass to server (optional)
* @return successful operation (status code 200)
*/
@Operation(
summary = "uploads an image (required)",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)))
},
security = {
@SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" })
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/{petId}/uploadImageWithRequiredFile",
produces = "application/json",
consumes = "multipart/form-data"
)
ResponseEntity<ModelApiResponse> uploadFileWithRequiredFile(
@Parameter(name = "petId", description = "ID of pet to update", required = true, schema = @Schema(description = "")) @PathVariable("petId") Long petId,
@Parameter(name = "requiredFile", description = "file to upload", required = true, schema = @Schema(description = "")) @RequestParam("requiredFile") MultipartFile requiredFile,
@Parameter(name = "additionalMetadata", description = "Additional data to pass to server", schema = @Schema(description = "")) @RequestParam(value="additionalMetadata", required=false) String additionalMetadata
);
}

View File

@@ -0,0 +1,139 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.util.Map;
import org.openapitools.model.Order;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "Store", description = "the Store API")
public interface StoreApi {
/**
* DELETE /store/order/{order_id} : Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
* @param orderId ID of the order that needs to be deleted (required)
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
@Operation(
summary = "Delete purchase order by ID",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Order not found")
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/store/order/{order_id}"
)
ResponseEntity<Void> deleteOrder(
@Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("order_id") String orderId
);
/**
* GET /store/inventory : Returns pet inventories by status
* Returns a map of status codes to quantities
*
* @return successful operation (status code 200)
*/
@Operation(
summary = "Returns pet inventories by status",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)))
},
security = {
@SecurityRequirement(name = "api_key")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/store/inventory",
produces = "application/json"
)
ResponseEntity<Map<String, Integer>> getInventory(
);
/**
* GET /store/order/{order_id} : Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
* @param orderId ID of pet that needs to be fetched (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
@Operation(
summary = "Find purchase order by ID",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))),
@ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
@ApiResponse(responseCode = "404", description = "Order not found")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/store/order/{order_id}",
produces = "application/json"
)
ResponseEntity<Order> getOrderById(
@Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, schema = @Schema(description = "")) @PathVariable("order_id") Long orderId
);
/**
* POST /store/order : Place an order for a pet
*
* @param body order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@Operation(
summary = "Place an order for a pet",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class))),
@ApiResponse(responseCode = "400", description = "Invalid Order")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/store/order",
produces = "application/json"
)
ResponseEntity<Order> placeOrder(
@Parameter(name = "body", description = "order placed for purchasing the pet", required = true, schema = @Schema(description = "")) @Valid @RequestBody Order body
);
}

View File

@@ -0,0 +1,230 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import java.util.List;
import java.time.OffsetDateTime;
import org.openapitools.model.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Tag(name = "User", description = "the User API")
public interface UserApi {
/**
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Create user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user"
)
ResponseEntity<Void> createUser(
@Parameter(name = "body", description = "Created user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Creates list of users with given input array",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithArray"
)
ResponseEntity<Void> createUsersWithArrayInput(
@Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List<User> body
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
* @param body List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
summary = "Creates list of users with given input array",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithList"
)
ResponseEntity<Void> createUsersWithListInput(
@Parameter(name = "body", description = "List of user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody List<User> body
);
/**
* DELETE /user/{username} : Delete user
* This can only be done by the logged in user.
*
* @param username The name that needs to be deleted (required)
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Delete user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.DELETE,
value = "/user/{username}"
)
ResponseEntity<Void> deleteUser(
@Parameter(name = "username", description = "The name that needs to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username
);
/**
* GET /user/{username} : Get user by user name
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Get user by user name",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))),
@ApiResponse(responseCode = "400", description = "Invalid username supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/{username}",
produces = "application/json"
)
ResponseEntity<User> getUserByName(
@Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, schema = @Schema(description = "")) @PathVariable("username") String username
);
/**
* GET /user/login : Logs user into the system
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
@Operation(
summary = "Logs user into the system",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = @Content(mediaType = "application/json", schema = @Schema(implementation = String.class))),
@ApiResponse(responseCode = "400", description = "Invalid username/password supplied")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/login",
produces = "application/json"
)
ResponseEntity<String> loginUser(
@NotNull @Parameter(name = "username", description = "The user name for login", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "username", required = true) String username,
@NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, schema = @Schema(description = "")) @Valid @RequestParam(value = "password", required = true) String password
);
/**
* GET /user/logout : Logs out current logged in user session
*
* @return successful operation (status code 200)
*/
@Operation(
summary = "Logs out current logged in user session",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
}
)
@RequestMapping(
method = RequestMethod.GET,
value = "/user/logout"
)
ResponseEntity<Void> logoutUser(
);
/**
* PUT /user/{username} : Updated user
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@Operation(
summary = "Updated user",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "400", description = "Invalid user supplied"),
@ApiResponse(responseCode = "404", description = "User not found")
}
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/user/{username}"
)
ResponseEntity<Void> updateUser(
@Parameter(name = "username", description = "name that need to be deleted", required = true, schema = @Schema(description = "")) @PathVariable("username") String username,
@Parameter(name = "body", description = "Updated user object", required = true, schema = @Schema(description = "")) @Valid @RequestBody User body
);
}

View File

@@ -0,0 +1,86 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesAnyType
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesAnyType name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesAnyType {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,87 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesArray
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesArray extends HashMap<String, List> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesArray name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
return Objects.equals(this.name, additionalPropertiesArray.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesArray {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,86 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesBoolean
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesBoolean name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesBoolean {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,414 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesClass
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesClass {
@JsonProperty("map_string")
@Valid
private Map<String, String> mapString = null;
@JsonProperty("map_number")
@Valid
private Map<String, BigDecimal> mapNumber = null;
@JsonProperty("map_integer")
@Valid
private Map<String, Integer> mapInteger = null;
@JsonProperty("map_boolean")
@Valid
private Map<String, Boolean> mapBoolean = null;
@JsonProperty("map_array_integer")
@Valid
private Map<String, List<Integer>> mapArrayInteger = null;
@JsonProperty("map_array_anytype")
@Valid
private Map<String, List<Object>> mapArrayAnytype = null;
@JsonProperty("map_map_string")
@Valid
private Map<String, Map<String, String>> mapMapString = null;
@JsonProperty("map_map_anytype")
@Valid
private Map<String, Map<String, Object>> mapMapAnytype = null;
@JsonProperty("anytype_1")
private Object anytype1;
@JsonProperty("anytype_2")
private Object anytype2;
@JsonProperty("anytype_3")
private Object anytype3;
public AdditionalPropertiesClass mapString(Map<String, String> mapString) {
this.mapString = mapString;
return this;
}
public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
if (this.mapString == null) {
this.mapString = new HashMap<>();
}
this.mapString.put(key, mapStringItem);
return this;
}
/**
* Get mapString
* @return mapString
*/
@Schema(name = "mapString", defaultValue = "")
public Map<String, String> getMapString() {
return mapString;
}
public void setMapString(Map<String, String> mapString) {
this.mapString = mapString;
}
public AdditionalPropertiesClass mapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
return this;
}
public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
if (this.mapNumber == null) {
this.mapNumber = new HashMap<>();
}
this.mapNumber.put(key, mapNumberItem);
return this;
}
/**
* Get mapNumber
* @return mapNumber
*/
@Schema(name = "mapNumber", defaultValue = "")
@Valid
public Map<String, BigDecimal> getMapNumber() {
return mapNumber;
}
public void setMapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
}
public AdditionalPropertiesClass mapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
return this;
}
public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
if (this.mapInteger == null) {
this.mapInteger = new HashMap<>();
}
this.mapInteger.put(key, mapIntegerItem);
return this;
}
/**
* Get mapInteger
* @return mapInteger
*/
@Schema(name = "mapInteger", defaultValue = "")
public Map<String, Integer> getMapInteger() {
return mapInteger;
}
public void setMapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
}
public AdditionalPropertiesClass mapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
return this;
}
public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
if (this.mapBoolean == null) {
this.mapBoolean = new HashMap<>();
}
this.mapBoolean.put(key, mapBooleanItem);
return this;
}
/**
* Get mapBoolean
* @return mapBoolean
*/
@Schema(name = "mapBoolean", defaultValue = "")
public Map<String, Boolean> getMapBoolean() {
return mapBoolean;
}
public void setMapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
}
public AdditionalPropertiesClass mapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
return this;
}
public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List<Integer> mapArrayIntegerItem) {
if (this.mapArrayInteger == null) {
this.mapArrayInteger = new HashMap<>();
}
this.mapArrayInteger.put(key, mapArrayIntegerItem);
return this;
}
/**
* Get mapArrayInteger
* @return mapArrayInteger
*/
@Schema(name = "mapArrayInteger", defaultValue = "")
@Valid
public Map<String, List<Integer>> getMapArrayInteger() {
return mapArrayInteger;
}
public void setMapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
}
public AdditionalPropertiesClass mapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
return this;
}
public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List<Object> mapArrayAnytypeItem) {
if (this.mapArrayAnytype == null) {
this.mapArrayAnytype = new HashMap<>();
}
this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
return this;
}
/**
* Get mapArrayAnytype
* @return mapArrayAnytype
*/
@Schema(name = "mapArrayAnytype", defaultValue = "")
@Valid
public Map<String, List<Object>> getMapArrayAnytype() {
return mapArrayAnytype;
}
public void setMapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
}
public AdditionalPropertiesClass mapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
return this;
}
public AdditionalPropertiesClass putMapMapStringItem(String key, Map<String, String> mapMapStringItem) {
if (this.mapMapString == null) {
this.mapMapString = new HashMap<>();
}
this.mapMapString.put(key, mapMapStringItem);
return this;
}
/**
* Get mapMapString
* @return mapMapString
*/
@Schema(name = "mapMapString", defaultValue = "")
@Valid
public Map<String, Map<String, String>> getMapMapString() {
return mapMapString;
}
public void setMapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
}
public AdditionalPropertiesClass mapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
return this;
}
public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map<String, Object> mapMapAnytypeItem) {
if (this.mapMapAnytype == null) {
this.mapMapAnytype = new HashMap<>();
}
this.mapMapAnytype.put(key, mapMapAnytypeItem);
return this;
}
/**
* Get mapMapAnytype
* @return mapMapAnytype
*/
@Schema(name = "mapMapAnytype", defaultValue = "")
@Valid
public Map<String, Map<String, Object>> getMapMapAnytype() {
return mapMapAnytype;
}
public void setMapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
}
public AdditionalPropertiesClass anytype1(Object anytype1) {
this.anytype1 = anytype1;
return this;
}
/**
* Get anytype1
* @return anytype1
*/
@Schema(name = "anytype1", defaultValue = "")
public Object getAnytype1() {
return anytype1;
}
public void setAnytype1(Object anytype1) {
this.anytype1 = anytype1;
}
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
return this;
}
/**
* Get anytype2
* @return anytype2
*/
@Schema(name = "anytype2", defaultValue = "")
public Object getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
this.anytype2 = anytype2;
}
public AdditionalPropertiesClass anytype3(Object anytype3) {
this.anytype3 = anytype3;
return this;
}
/**
* Get anytype3
* @return anytype3
*/
@Schema(name = "anytype3", defaultValue = "")
public Object getAnytype3() {
return anytype3;
}
public void setAnytype3(Object anytype3) {
this.anytype3 = anytype3;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
return Objects.equals(this.mapString, additionalPropertiesClass.mapString) &&
Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) &&
Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) &&
Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) &&
Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) &&
Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) &&
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesClass {\n");
sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n");
sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n");
sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n");
sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n");
sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n");
sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n");
sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n");
sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n");
sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n");
sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,86 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesInteger
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesInteger name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
return Objects.equals(this.name, additionalPropertiesInteger.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesInteger {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,87 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesNumber
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesNumber name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
return Objects.equals(this.name, additionalPropertiesNumber.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesNumber {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,86 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesObject
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesObject extends HashMap<String, Map> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesObject name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
return Objects.equals(this.name, additionalPropertiesObject.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesObject {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,86 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.HashMap;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* AdditionalPropertiesString
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class AdditionalPropertiesString extends HashMap<String, String> {
@JsonProperty("name")
private String name;
public AdditionalPropertiesString name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
*/
@Schema(name = "name", defaultValue = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
return Objects.equals(this.name, additionalPropertiesString.name) &&
super.equals(o);
}
@Override
public int hashCode() {
return Objects.hash(name, super.hashCode());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdditionalPropertiesString {\n");
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,118 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* Animal
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
@JsonSubTypes({
@JsonSubTypes.Type(value = BigCat.class, name = "BigCat"),
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
})
public class Animal {
@JsonProperty("className")
private String className;
@JsonProperty("color")
private String color = "red";
public Animal className(String className) {
this.className = className;
return this;
}
/**
* Get className
* @return className
*/
@Schema(name = "className", required = true, defaultValue = "")
@NotNull
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public Animal color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
*/
@Schema(name = "color", defaultValue = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Animal animal = (Animal) o;
return Objects.equals(this.className, animal.className) &&
Objects.equals(this.color, animal.color);
}
@Override
public int hashCode() {
return Objects.hash(className, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Animal {\n");
sb.append(" className: ").append(toIndentedString(className)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -0,0 +1,96 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
/**
* ArrayOfArrayOfNumberOnly
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
@Valid
private List<List<BigDecimal>> arrayArrayNumber = null;
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
return this;
}
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
if (this.arrayArrayNumber == null) {
this.arrayArrayNumber = new ArrayList<>();
}
this.arrayArrayNumber.add(arrayArrayNumberItem);
return this;
}
/**
* Get arrayArrayNumber
* @return arrayArrayNumber
*/
@Schema(name = "arrayArrayNumber", defaultValue = "")
@Valid
public List<List<BigDecimal>> getArrayArrayNumber() {
return arrayArrayNumber;
}
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
}
@Override
public int hashCode() {
return Objects.hash(arrayArrayNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayOfArrayOfNumberOnly {\n");
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

Some files were not shown because too many files have changed in this diff Show More