From 8f8fd85fd664c8b14a17a8aa3797fb522ce28368 Mon Sep 17 00:00:00 2001 From: krasv Date: Thu, 21 Sep 2023 11:08:24 +0200 Subject: [PATCH] contribution #6123: add spring support for SSE conform specs (#16543) * add spring support for SSE conform specs see https://github.com/OpenAPITools/openapi-generator/issues/6123 for the ongoing discussion * extend generator option documentation * applied review suggestions * regenerated samples * regenerated docu * fix code style: removed tabs --- .../codegen/languages/SpringCodegen.java | 54 +++++++ .../main/resources/JavaSpring/api.mustache | 5 +- .../resources/JavaSpring/apiDelegate.mustache | 2 +- .../resources/JavaSpring/methodBody.mustache | 8 +- .../JavaSpring/responseType.mustache | 1 + .../java/spring/SpringCodegenTest.java | 147 ++++++++++++++---- .../src/test/resources/3_0/sse.yaml | 62 ++++++++ .../java/org/openapitools/api/DefaultApi.java | 2 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/PetController.java | 8 + .../org/openapitools/api/StoreController.java | 4 + .../org/openapitools/api/UserController.java | 9 ++ .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/DefaultApi.java | 2 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../api/FakeClassnameTags123Api.java | 1 + .../java/org/openapitools/api/PetApi.java | 10 ++ .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 9 ++ .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/BarApi.java | 1 + .../java/org/openapitools/api/FooApi.java | 2 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/NullableApi.java | 1 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 9 ++ .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/VersioningApi.java | 3 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 9 ++ .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/VersioningApi.java | 3 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 9 ++ .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/VersioningApi.java | 3 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 9 ++ .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../org/openapitools/api/VersioningApi.java | 3 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + .../virtualan/api/AnotherFakeApi.java | 1 + .../openapitools/virtualan/api/FakeApi.java | 17 ++ .../virtualan/api/FakeClassnameTestApi.java | 1 + .../openapitools/virtualan/api/PetApi.java | 8 + .../openapitools/virtualan/api/StoreApi.java | 4 + .../openapitools/virtualan/api/UserApi.java | 8 + .../org/openapitools/api/AnotherFakeApi.java | 1 + .../java/org/openapitools/api/FakeApi.java | 17 ++ .../api/FakeClassnameTestApi.java | 1 + .../java/org/openapitools/api/PetApi.java | 8 + .../java/org/openapitools/api/StoreApi.java | 4 + .../java/org/openapitools/api/UserApi.java | 8 + 172 files changed, 1287 insertions(+), 32 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache create mode 100644 modules/openapi-generator/src/test/resources/3_0/sse.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index b2ae0ecd991..8d10dbd6484 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -68,6 +68,7 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; +import io.swagger.v3.oas.models.media.MediaType; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.parameters.Parameter; import io.swagger.v3.oas.models.servers.Server; @@ -96,6 +97,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String ASYNC = "async"; public static final String REACTIVE = "reactive"; + public static final String SSE = "serverSentEvents"; public static final String RESPONSE_WRAPPER = "responseWrapper"; public static final String USE_TAGS = "useTags"; public static final String SPRING_BOOT = "spring-boot"; @@ -144,6 +146,7 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean singleContentTypes = false; protected boolean async = false; protected boolean reactive = false; + protected boolean sse = false; protected String responseWrapper = ""; protected boolean skipDefaultInterface = false; protected boolean useTags = false; @@ -448,6 +451,9 @@ public class SpringCodegen extends AbstractJavaCodegen throw new IllegalArgumentException("Currently, reactive option doesn't supported by Spring Cloud"); } this.setReactive(Boolean.parseBoolean(additionalProperties.get(REACTIVE).toString())); + if (additionalProperties.containsKey(SSE)) { + this.setSse(Boolean.parseBoolean(additionalProperties.get(SSE).toString())); + } } if (additionalProperties.containsKey(RESPONSE_WRAPPER)) { @@ -1069,6 +1075,10 @@ public class SpringCodegen extends AbstractJavaCodegen this.reactive = reactive; } + public void setSse(boolean sse) { + this.sse = sse; + } + public void setResponseWrapper(String responseWrapper) { this.responseWrapper = responseWrapper; } @@ -1249,6 +1259,50 @@ public class SpringCodegen extends AbstractJavaCodegen if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) { codegenOperation.imports.add("ApiIgnore"); } + if (sse) { + var MEDIA_EVENT_STREAM = "text/event-stream"; + // inspecting used streaming media types + /* + expected definition: + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + type: or + $ref: + */ + Map> schemaTypes = operation.getResponses().entrySet().stream() + .map(e -> Pair.of(e.getValue(), fromResponse(e.getKey(), e.getValue()))) + .filter(p -> p.getRight().is2xx) // consider only success + .map(p -> p.getLeft().getContent().get(MEDIA_EVENT_STREAM)) + .map(MediaType::getSchema) + .collect(Collectors.toList()).stream() + .collect(Collectors.groupingBy(Schema::getType)); + if(schemaTypes.containsKey("array")) { + // we have a match with SSE pattern + // double check potential conflicting, multiple specs + if(schemaTypes.keySet().size() > 1) { + throw new RuntimeException("only 1 response media type supported, when SSE is detected"); + } + // double check schema format + List eventTypes = schemaTypes.get("array"); + if( eventTypes.stream().anyMatch(schema -> !"event-stream".equalsIgnoreCase(schema.getFormat()))) { + throw new RuntimeException("schema format 'event-stream' is required, when SSE is detected"); + } + // double check item types + Set itemTypes = eventTypes.stream() + .map(schema -> schema.getItems().getType() != null + ? schema.getItems().getType() + : schema.getItems().get$ref()) + .collect(Collectors.toSet()); + if(itemTypes.size() > 1) { + throw new RuntimeException("only single item type is supported, when SSE is detected"); + } + codegenOperation.vendorExtensions.put("x-sse", true); + } // Not an SSE compliant definition + } } return codegenOperation; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 743e188c8e3..9c74f70469e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -246,7 +246,8 @@ public interface {{classname}} { {{#vendorExtensions.x-operation-extra-annotation}} {{{.}}} {{/vendorExtensions.x-operation-extra-annotation}} - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}( + {{#vendorExtensions.x-sse}}@ResponseBody{{/vendorExtensions.x-sse}} + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, @@ -257,7 +258,7 @@ public interface {{classname}} { } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#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{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{>responseType}} {{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{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index 64dec32d8f8..31e69a208f3 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -66,7 +66,7 @@ public interface {{classname}}Delegate { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#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{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{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{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{>methodBody}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index 1d3aeb0a6f1..df3c53532a1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -31,6 +31,7 @@ return CompletableFuture.supplyAsync(()-> { {{/examples}} {{/reactive}} {{#reactive}} +{{^vendorExtensions.x-sse}} Mono result = Mono.empty(); {{#examples}} {{#-first}} @@ -50,4 +51,9 @@ Mono result = Mono.empty(); exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); {{/examples}} return result{{#allParams}}{{#isBodyParam}}{{^isArray}}{{#paramName}}.then({{.}}){{/paramName}}{{/isArray}}{{#isArray}}{{#paramName}}.thenMany({{.}}){{/paramName}}{{/isArray}}{{/isBodyParam}}{{/allParams}}.then(Mono.empty()); -{{/reactive}} +{{/vendorExtensions.x-sse}} +{{#vendorExtensions.x-sse}} +exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); + return Flux.empty(); +{{/vendorExtensions.x-sse}} +{{/reactive}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache new file mode 100644 index 00000000000..4bea517eed6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache @@ -0,0 +1 @@ +{{^vendorExtensions.x-sse}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}}{{/vendorExtensions.x-sse}}{{#vendorExtensions.x-sse}}{{>returnTypes}}{{/vendorExtensions.x-sse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 9a50dedaa49..dd90153176e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -17,15 +17,56 @@ package org.openapitools.codegen.java.spring; -import com.google.common.collect.ImmutableMap; -import io.swagger.parser.OpenAPIParser; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.servers.Server; -import io.swagger.v3.parser.core.models.ParseOptions; -import org.openapitools.codegen.*; +import static java.util.stream.Collectors.groupingBy; +import static org.assertj.core.api.Assertions.assertThat; +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileNotContains; +import static org.openapitools.codegen.languages.SpringCodegen.ASYNC; +import static org.openapitools.codegen.languages.SpringCodegen.DELEGATE_PATTERN; +import static org.openapitools.codegen.languages.SpringCodegen.DocumentationProvider; +import static org.openapitools.codegen.languages.SpringCodegen.IMPLICIT_HEADERS; +import static org.openapitools.codegen.languages.SpringCodegen.INTERFACE_ONLY; +import static org.openapitools.codegen.languages.SpringCodegen.OPENAPI_NULLABLE; +import static org.openapitools.codegen.languages.SpringCodegen.REACTIVE; +import static org.openapitools.codegen.languages.SpringCodegen.REQUEST_MAPPING_OPTION; +import static org.openapitools.codegen.languages.SpringCodegen.RESPONSE_WRAPPER; +import static org.openapitools.codegen.languages.SpringCodegen.RETURN_SUCCESS_CODE; +import static org.openapitools.codegen.languages.SpringCodegen.SKIP_DEFAULT_INTERFACE; +import static org.openapitools.codegen.languages.SpringCodegen.SPRING_BOOT; +import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CLOUD_LIBRARY; +import static org.openapitools.codegen.languages.SpringCodegen.SPRING_CONTROLLER; +import static org.openapitools.codegen.languages.SpringCodegen.SSE; +import static org.openapitools.codegen.languages.SpringCodegen.USE_ENUM_CASE_INSENSITIVE; +import static org.openapitools.codegen.languages.SpringCodegen.USE_RESPONSE_ENTITY; +import static org.openapitools.codegen.languages.SpringCodegen.USE_SPRING_BOOT3; +import static org.openapitools.codegen.languages.SpringCodegen.USE_TAGS; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; +import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.fail; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.assertj.core.api.MapAssert; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.config.CodegenConfigurator; import org.openapitools.codegen.config.GlobalSettings; import org.openapitools.codegen.java.assertions.JavaFileAssert; @@ -40,26 +81,15 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Ignore; import org.testng.annotations.Test; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.stream.Collectors; +import com.google.common.collect.ImmutableMap; -import static java.util.stream.Collectors.groupingBy; -import static org.assertj.core.api.Assertions.assertThat; -import static org.openapitools.codegen.TestUtils.assertFileContains; -import static org.openapitools.codegen.TestUtils.assertFileNotContains; -import static org.openapitools.codegen.languages.SpringCodegen.*; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; -import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.fail; +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.parser.core.models.ParseOptions; public class SpringCodegenTest { @@ -3084,4 +3114,65 @@ public class SpringCodegenTest { JavaFileAssert.assertThat(files.get("PingTagApi.java")) .fileContains("This is a multine tag : * tag item 1 * tag item 2 "); } + + @Test + public void testSSEOperationSupport() throws Exception { + + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/sse.yaml"); + final SpringCodegen codegen = new SpringCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(SSE, "true"); + codegen.additionalProperties().put(REACTIVE, "true"); + codegen.additionalProperties().put(INTERFACE_ONLY, "false"); + codegen.additionalProperties().put(DELEGATE_PATTERN, "true"); + + ClientOptInput input = new ClientOptInput(); + input.openAPI(openAPI); + input.config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + Map files = generator.opts(input).generate().stream() + .collect(Collectors.toMap(File::getName, Function.identity())); + + MapAssert.assertThatMap(files).isNotEmpty(); + File api = files.get("PathApi.java"); + File delegate = files.get("PathApiDelegate.java"); + + JavaFileAssert.assertThat(api) + .assertMethod("sseVariant1", "ServerWebExchange") + .isNotNull() + .hasReturnType("Flux") + .toFileAssert() + .assertMethod("sseVariant2", "ServerWebExchange") + .isNotNull() + .hasReturnType("Flux") + .toFileAssert() + .assertMethod("nonSSE", "ServerWebExchange") + .isNotNull() + .hasReturnType("Mono>"); + + JavaFileAssert.assertThat(delegate) + .assertMethod("sseVariant1", "ServerWebExchange") + .isNotNull() + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() + .assertMethod("sseVariant2", "ServerWebExchange") + .isNotNull() + .hasReturnType("Flux") + .bodyContainsLines("return Flux.empty();") + .toFileAssert() + .assertMethod("nonSSE", "ServerWebExchange") + .isNotNull() + .hasReturnType("Mono>") + .bodyContainsLines("return result.then(Mono.empty());") + ; + + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/sse.yaml b/modules/openapi-generator/src/test/resources/3_0/sse.yaml new file mode 100644 index 00000000000..cdc613b2a4e --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/sse.yaml @@ -0,0 +1,62 @@ +openapi: 3.0.1 +info: + title: SSE test + description: SSE test cases + version: 1.0.0 +servers: + - url: 'https' +tags: + - name: sse +paths: + /path/variant1: + post: + operationId: sseVariant1 + tags: + - sse + responses: + '200': + description: acknowledged + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + type: string + /path/variant2: + post: + operationId: sseVariant2 + tags: + - sse + responses: + '200': + description: acknowledged + content: + text/event-stream: + schema: + type: array + format: event-stream + items: + $ref: '#/components/schemas/EventType' + /path/variant3: + post: + operationId: nonSSE + tags: + - sse + responses: + '200': + description: acknowledged + content: + text/event-stream: + schema: + type: string + format: event-stream +components: + schemas: + EventType: + type: object + properties: + attribute1: + type: string + + diff --git a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index f76215e9821..f4cfbc41db5 100644 --- a/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -50,6 +50,7 @@ public interface DefaultApi { method = RequestMethod.GET, value = "/thingy/{date}" ) + ResponseEntity get( @ApiParam(value = "A date path parameter", required = true, defaultValue = "1972-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, @NotNull @ApiParam(value = "A date-time query parameter", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @@ -79,6 +80,7 @@ public interface DefaultApi { value = "/thingy/{date}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @ApiParam(value = "A date path parameter", required = true, defaultValue = "1970-01-01") @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, @ApiParam(value = "Updated last visit timestamp", defaultValue = "1971-12-19T03:39:57-08:00") @Valid @RequestParam(value = "visitDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java index f327113b0f4..a203af27250 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java @@ -59,6 +59,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -91,6 +92,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -127,6 +129,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -164,6 +167,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -198,6 +202,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -240,6 +245,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -274,6 +280,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -312,6 +319,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java index 18f948391d7..d6d0287be55 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -80,6 +81,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -111,6 +113,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -141,6 +144,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java index 8c5829baec0..d153abd2741 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java @@ -52,6 +52,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ); @@ -81,6 +82,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ); @@ -110,6 +112,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ); @@ -140,6 +143,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -171,6 +175,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -201,6 +206,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -229,6 +235,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -261,6 +268,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java index 198c99b84c3..5c735d80c83 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java @@ -56,6 +56,7 @@ public interface PetController { value = "/pet", consumes = "application/json" ) + ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -87,6 +88,7 @@ public interface PetController { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -124,6 +126,7 @@ public interface PetController { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable @@ -163,6 +166,7 @@ public interface PetController { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable @@ -198,6 +202,7 @@ public interface PetController { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -233,6 +238,7 @@ public interface PetController { value = "/pet", consumes = "application/json" ) + ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -266,6 +272,7 @@ public interface PetController { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -303,6 +310,7 @@ public interface PetController { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java index d092e797a84..36eba0006dd 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java @@ -50,6 +50,7 @@ public interface StoreController { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -80,6 +81,7 @@ public interface StoreController { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -111,6 +113,7 @@ public interface StoreController { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -139,6 +142,7 @@ public interface StoreController { value = "/store/order", produces = "application/json" ) + ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java index 8ca66fa7cdc..e11d84cb372 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java @@ -48,6 +48,7 @@ public interface UserController { method = RequestMethod.POST, value = "/user" ) + ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body ); @@ -72,6 +73,7 @@ public interface UserController { method = RequestMethod.POST, value = "/user/createWithArray" ) + ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ); @@ -96,6 +98,7 @@ public interface UserController { method = RequestMethod.POST, value = "/user/createWithList" ) + ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ); @@ -123,6 +126,7 @@ public interface UserController { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -153,6 +157,7 @@ public interface UserController { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -182,6 +187,7 @@ public interface UserController { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -206,6 +212,7 @@ public interface UserController { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -229,6 +236,7 @@ public interface UserController { method = RequestMethod.OPTIONS, value = "/user/logout" ) + ResponseEntity logoutUserOptions( ); @@ -257,6 +265,7 @@ public interface UserController { method = RequestMethod.PUT, value = "/user/{username}" ) + ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index f327113b0f4..a203af27250 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -59,6 +59,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -91,6 +92,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -127,6 +129,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -164,6 +167,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -198,6 +202,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ); @@ -240,6 +245,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -274,6 +280,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -312,6 +319,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 18f948391d7..d6d0287be55 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ); @@ -80,6 +81,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -111,6 +113,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ); @@ -141,6 +144,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 8c5829baec0..d153abd2741 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -52,6 +52,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ); @@ -81,6 +82,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ); @@ -110,6 +112,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ); @@ -140,6 +143,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ); @@ -171,6 +175,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ); @@ -201,6 +206,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -229,6 +235,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -261,6 +268,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java index c89af1a1a41..9a547c6c112 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java @@ -40,6 +40,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @Valid @RequestBody Pet pet ); @@ -57,6 +58,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @PathVariable("petId") Long petId, @RequestHeader(value = "api_key", required = false) Optional apiKey @@ -76,6 +78,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -96,6 +99,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -115,6 +119,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -138,6 +143,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @Valid @RequestBody Pet pet ); @@ -157,6 +163,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "name", required = false) String name, @@ -179,6 +186,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java index 3aca0efac53..27cb2c872e1 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java @@ -38,6 +38,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @PathVariable("orderId") String orderId ); @@ -54,6 +55,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -73,6 +75,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId ); @@ -92,6 +95,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java index 521ee1ec680..45f234ef52d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java @@ -38,6 +38,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @Valid @RequestBody User user ); @@ -55,6 +56,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @Valid @RequestBody List user ); @@ -72,6 +74,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @Valid @RequestBody List user ); @@ -89,6 +92,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @PathVariable("username") String username ); @@ -108,6 +112,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -127,6 +132,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password @@ -143,6 +149,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -162,6 +169,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @PathVariable("username") String username, @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java index b5b39d8e742..aa4f9cda66e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java @@ -68,6 +68,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -97,6 +98,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -169,6 +172,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -205,6 +209,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -247,6 +252,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -278,6 +284,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -314,6 +321,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java index 375ae369a15..d2a4c03c7da 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ); @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -155,6 +158,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java index 6a56fbc20fa..028b64ff4f3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java @@ -62,6 +62,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); @@ -91,6 +92,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -120,6 +122,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -150,6 +153,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -183,6 +187,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -215,6 +220,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -243,6 +249,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -275,6 +282,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 1d324f50974..fa52f39ccee 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -69,6 +69,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + CompletableFuture> addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -98,6 +99,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + CompletableFuture> deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -133,6 +135,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + CompletableFuture>> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -170,6 +173,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + CompletableFuture>> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -206,6 +210,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + CompletableFuture> getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -248,6 +253,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + CompletableFuture> updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -279,6 +285,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + CompletableFuture> updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -315,6 +322,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + CompletableFuture> uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index ebd61552b0a..f07582d5ce8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -61,6 +61,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + CompletableFuture> deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ); @@ -91,6 +92,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + CompletableFuture>> getInventory( ); @@ -124,6 +126,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + CompletableFuture> getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -156,6 +159,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + CompletableFuture> placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 96951205a9e..a669adc9f2e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -63,6 +63,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + CompletableFuture> createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); @@ -92,6 +93,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + CompletableFuture> createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -121,6 +123,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + CompletableFuture> createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -151,6 +154,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + CompletableFuture> deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -184,6 +188,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + CompletableFuture> getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -216,6 +221,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + CompletableFuture> loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -244,6 +250,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + CompletableFuture> logoutUser( ); @@ -276,6 +283,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + CompletableFuture> updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java index ddf6b779c6a..ab1bfe6992f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-date-time/src/main/java/org/openapitools/api/DefaultApi.java @@ -58,6 +58,7 @@ public interface DefaultApi { method = RequestMethod.GET, value = "/thingy/{date}" ) + ResponseEntity get( @Parameter(name = "date", description = "A date path parameter", required = true, in = ParameterIn.PATH) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, @NotNull @Parameter(name = "dateTime", description = "A date-time query parameter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "dateTime", required = true, defaultValue = "1973-12-19T03:39:57-08:00") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, @@ -86,6 +87,7 @@ public interface DefaultApi { value = "/thingy/{date}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "date", description = "A date path parameter", required = true, in = ParameterIn.PATH) @PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, @Parameter(name = "visitDate", description = "Updated last visit timestamp") @Valid @RequestParam(value = "visitDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime visitDate diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3e20eedc368..93210401a0f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -61,6 +61,7 @@ public interface AnotherFakeApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index bc0b9f113cf..1bcacb3f62f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -68,6 +68,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = "application/xml" ) + ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ); @@ -96,6 +97,7 @@ public interface FakeApi { produces = "*/*", consumes = "application/json" ) + ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ); @@ -124,6 +126,7 @@ public interface FakeApi { produces = "*/*", consumes = "application/json" ) + ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ); @@ -152,6 +155,7 @@ public interface FakeApi { produces = "*/*", consumes = "application/json" ) + ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ); @@ -180,6 +184,7 @@ public interface FakeApi { produces = "*/*", consumes = "application/json" ) + ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ); @@ -205,6 +210,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = "application/json" ) + ResponseEntity testBodyWithFileSchema( @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ); @@ -229,6 +235,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = "application/json" ) + ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user @@ -259,6 +266,7 @@ public interface FakeApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); @@ -303,6 +311,7 @@ public interface FakeApi { value = "/fake", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -351,6 +360,7 @@ public interface FakeApi { value = "/fake", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -388,6 +398,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -419,6 +430,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = "application/json" ) + ResponseEntity testInlineAdditionalProperties( @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ); @@ -446,6 +458,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -500,6 +513,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @@ -529,6 +543,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = "application/json" ) + ResponseEntity testWithResultExample( ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index ad3d22e0a50..f0dbbbc9059 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -64,6 +64,7 @@ public interface FakeClassnameTags123Api { produces = "application/json", consumes = "application/json" ) + ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index 308dfc4c248..13e702ba267 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -66,6 +66,7 @@ public interface PetApi { value = "/pet", consumes = "application/json" ) + ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -97,6 +98,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status ); @@ -169,6 +172,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags ); @@ -205,6 +209,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -230,6 +235,7 @@ public interface PetApi { value = "/fake/{petId}/response-object-different-names", produces = "application/json" ) + ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -265,6 +271,7 @@ public interface PetApi { value = "/pet", consumes = "application/json" ) + ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -296,6 +303,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -332,6 +340,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @@ -368,6 +377,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index aeb643ced04..17b7cadd843 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId ); @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ); @@ -155,6 +158,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index 38c64487591..0f9ae5b4a73 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -59,6 +59,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); @@ -85,6 +86,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -138,6 +141,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -171,6 +175,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -203,6 +208,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -228,6 +234,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -257,6 +264,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index c5b2990f856..a0418ffa9c8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = "application/json" ) + ResponseEntity addPet( @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -89,6 +90,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -124,6 +126,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable @@ -162,6 +165,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags, @ParameterObject final Pageable pageable @@ -199,6 +203,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -230,6 +235,7 @@ public interface PetApi { value = "/pet", consumes = "application/json" ) + ResponseEntity updatePet( @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ); @@ -259,6 +265,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -293,6 +300,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index a9d31d78cb6..68f537ff5f4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ); @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -152,6 +155,7 @@ public interface StoreApi { value = "/store/order", produces = "application/json" ) + ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 7b634ef29e6..c57b90951d4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -58,6 +58,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) + ResponseEntity createUser( @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body ); @@ -81,6 +82,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -104,6 +106,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) + ResponseEntity createUsersWithListInput( @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body ); @@ -131,6 +134,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -162,6 +166,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -192,6 +197,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -215,6 +221,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -237,6 +244,7 @@ public interface UserApi { method = RequestMethod.OPTIONS, value = "/user/logout" ) + ResponseEntity logoutUserOptions( ); @@ -265,6 +273,7 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index f36656735b4..7aa471d2aeb 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -68,6 +68,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -97,6 +98,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -169,6 +172,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ); @@ -205,6 +209,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -247,6 +252,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -278,6 +284,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -314,6 +321,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 65ce02af1be..cd1427025e5 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ); @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ); @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -155,6 +158,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index e8d27ffb2ee..0fc4481492e 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -62,6 +62,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); @@ -91,6 +92,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -120,6 +122,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -150,6 +153,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -183,6 +187,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -215,6 +220,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -243,6 +249,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ); @@ -275,6 +282,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java index a1349148cc6..6d723adc63d 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java @@ -68,6 +68,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -97,6 +98,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) throws Exception; @@ -169,6 +172,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ) throws Exception; @@ -205,6 +209,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -247,6 +252,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -278,6 +284,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -314,6 +321,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java index 124d64e6897..978b72fd207 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ) throws Exception; @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + ResponseEntity> getInventory( ) throws Exception; @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) throws Exception; @@ -155,6 +158,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java index d40ccb8d813..ff9e0ccbf5b 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java @@ -62,6 +62,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) throws Exception; @@ -91,6 +92,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -120,6 +122,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -150,6 +153,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -183,6 +187,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -215,6 +220,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -243,6 +249,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ) throws Exception; @@ -275,6 +282,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 588e7fc20a5..134deee1f85 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -72,6 +72,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -118,6 +119,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -156,6 +158,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = "application/json" ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -210,6 +213,7 @@ public interface PetApi { value = "/pet/findByTags", produces = "application/json" ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -263,6 +267,7 @@ public interface PetApi { value = "/pet/{petId}", produces = "application/json" ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -322,6 +327,7 @@ public interface PetApi { produces = "application/json", consumes = "application/json" ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -370,6 +376,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = "application/x-www-form-urlencoded" ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -409,6 +416,7 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data" ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index bfda3ffea83..4ef08632a41 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -64,6 +64,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ) { @@ -97,6 +98,7 @@ public interface StoreApi { value = "/store/inventory", produces = "application/json" ) + default ResponseEntity> getInventory( ) { @@ -133,6 +135,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = "application/json" ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { @@ -182,6 +185,7 @@ public interface StoreApi { produces = "application/json", consumes = "application/json" ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index b812e5baacf..f1547b4b6cc 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -66,6 +66,7 @@ public interface UserApi { value = "/user", consumes = "application/json" ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -98,6 +99,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = "application/json" ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -130,6 +132,7 @@ public interface UserApi { value = "/user/createWithList", consumes = "application/json" ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -163,6 +166,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -199,6 +203,7 @@ public interface UserApi { value = "/user/{username}", produces = "application/json" ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -248,6 +253,7 @@ public interface UserApi { value = "/user/login", produces = "application/json" ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -279,6 +285,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -314,6 +321,7 @@ public interface UserApi { value = "/user/{username}", consumes = "application/json" ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java index ceb3b339f90..f79476d21cc 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java @@ -64,6 +64,7 @@ public interface BarApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity createBar( @Parameter(name = "BarCreate", description = "", required = true) @Valid @RequestBody BarCreate barCreate ) { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java index 2f8dd188143..d07098a1e93 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java @@ -64,6 +64,7 @@ public interface FooApi { produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) + default ResponseEntity createFoo( @Parameter(name = "Foo", description = "The Foo to be created") @Valid @RequestBody(required = false) Foo foo ) { @@ -101,6 +102,7 @@ public interface FooApi { value = "/foo", produces = { "application/json;charset=utf-8" } ) + default ResponseEntity> getAllFoos( ) { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index a349111a279..133223e5e7c 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -72,6 +72,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -118,6 +119,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -156,6 +158,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -210,6 +213,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -263,6 +267,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -322,6 +327,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -370,6 +376,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -409,6 +416,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index d8e202aa918..93afbb176bb 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -64,6 +64,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ) { @@ -97,6 +98,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -133,6 +135,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { @@ -182,6 +185,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 4d6739489fd..7ca7bcff573 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -66,6 +66,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -98,6 +99,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -130,6 +132,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -163,6 +166,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -199,6 +203,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -248,6 +253,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -279,6 +285,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -314,6 +321,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java index 5adb83f70e1..2def7037cfc 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java @@ -72,6 +72,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -118,6 +119,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -156,6 +158,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -210,6 +213,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -263,6 +267,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -322,6 +327,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -370,6 +376,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -409,6 +416,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java index 84e3acbf213..6c7f49de370 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java @@ -64,6 +64,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ) { @@ -97,6 +98,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -133,6 +135,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { @@ -182,6 +185,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java index 1ca047752e8..a19f2eebd5a 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java @@ -66,6 +66,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -98,6 +99,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -130,6 +132,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -163,6 +166,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -199,6 +203,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -248,6 +253,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -279,6 +285,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -314,6 +321,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index b4ee569246e..7acf3f70c2a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -61,6 +61,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index f03dbda783d..0354411cc1f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -70,6 +70,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -100,6 +101,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -130,6 +132,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -160,6 +163,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -190,6 +194,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -217,6 +222,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -244,6 +250,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -270,6 +277,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user @@ -302,6 +310,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { @@ -348,6 +357,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -398,6 +408,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -437,6 +448,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -470,6 +482,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -499,6 +512,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -557,6 +571,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @@ -588,6 +603,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -624,6 +640,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f676e5b6038..38208d498d7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -64,6 +64,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 13660ca6499..ef8adaf2a5f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -65,6 +65,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -98,6 +99,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -135,6 +137,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status ) { @@ -174,6 +177,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -212,6 +216,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -249,6 +254,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -282,6 +288,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -320,6 +327,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 6e49ab342a4..8bb1ab6ad13 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId ) { @@ -92,6 +93,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -127,6 +129,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { @@ -161,6 +164,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index f5af6f53107..c6de11dca38 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -59,6 +59,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -87,6 +88,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -115,6 +117,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -144,6 +147,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -179,6 +183,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -213,6 +218,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -240,6 +246,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -271,6 +278,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 8e567d3d689..2fa946a0eda 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -65,6 +65,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 8a141fc1e03..480aa991b77 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -74,6 +74,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -105,6 +106,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -136,6 +138,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -176,6 +179,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -207,6 +211,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -235,6 +240,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -272,6 +278,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -299,6 +306,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user @@ -332,6 +340,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { @@ -388,6 +397,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -441,6 +451,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @@ -481,6 +492,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @@ -513,6 +525,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -543,6 +556,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -603,6 +617,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @@ -635,6 +650,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -681,6 +697,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0e14ec47dca..3611e8efe2f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -68,6 +68,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 314f1ee6d21..2ada20b139d 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -69,6 +69,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -105,6 +106,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -142,6 +144,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status ) { @@ -196,6 +199,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -249,6 +253,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -301,6 +306,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -335,6 +341,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -374,6 +381,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index c3ec78711ce..8872ce90d1c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -64,6 +64,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId ) { @@ -97,6 +98,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -133,6 +135,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { @@ -182,6 +185,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 39364508901..0c90bce5451 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -63,6 +63,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -92,6 +93,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -121,6 +123,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -151,6 +154,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -187,6 +191,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -236,6 +241,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -264,6 +270,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -296,6 +303,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index dc1782b890d..1884e7c96d6 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Valid @RequestBody Pet pet ) { @@ -78,6 +79,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @PathVariable("petId") Long petId, @RequestHeader(value = "api_key", required = false) String apiKey @@ -100,6 +102,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -137,6 +140,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -173,6 +177,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @PathVariable("petId") Long petId ) { @@ -213,6 +218,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Valid @RequestBody Pet pet ) { @@ -249,6 +255,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "name", required = false) String name, @@ -274,6 +281,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index 5c7d2045127..312c65eb077 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @PathVariable("orderId") String orderId ) { @@ -61,6 +62,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -83,6 +85,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId ) { @@ -119,6 +122,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index 332118a3a8f..7b99a0122ea 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Valid @RequestBody User user ) { @@ -62,6 +63,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Valid @RequestBody List user ) { @@ -82,6 +84,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Valid @RequestBody List user ) { @@ -102,6 +105,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @PathVariable("username") String username ) { @@ -124,6 +128,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @PathVariable("username") String username ) { @@ -160,6 +165,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password @@ -179,6 +185,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -201,6 +208,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @PathVariable("username") String username, @Valid @RequestBody User user diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 2ce96c4819c..da720da885f 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -73,6 +73,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -119,6 +120,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -157,6 +159,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -211,6 +214,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -264,6 +268,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -323,6 +328,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -371,6 +377,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -410,6 +417,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index e6baf04361b..219dfe0e941 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -65,6 +65,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @Parameter(name = "orderId", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("orderId") String orderId ) { @@ -98,6 +99,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -134,6 +136,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { @@ -183,6 +186,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 10870729eb3..143037d3d6f 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -67,6 +67,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -99,6 +100,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -131,6 +133,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -164,6 +167,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -200,6 +204,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -249,6 +254,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -280,6 +286,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -315,6 +322,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java index e0e9847a99d..c39f0b2dd1b 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -61,6 +61,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java index 517bd237005..2d8c4224370 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java @@ -70,6 +70,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) throws Exception; @@ -98,6 +99,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) throws Exception; @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) throws Exception; @@ -154,6 +157,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) throws Exception; @@ -182,6 +186,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) throws Exception; @@ -207,6 +212,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -232,6 +238,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + ResponseEntity testBodyWithFileSchema( @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) throws Exception; @@ -256,6 +263,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user @@ -286,6 +294,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; @@ -330,6 +339,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -378,6 +388,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -415,6 +426,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -446,6 +458,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + ResponseEntity testInlineAdditionalProperties( @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) throws Exception; @@ -473,6 +486,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -527,6 +541,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @@ -556,6 +571,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + ResponseEntity testWithResultExample( ) throws Exception; @@ -590,6 +606,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 5e679d5b62e..a487f8f3a23 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -64,6 +64,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java index ce2393d8989..301398fd36d 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java @@ -65,6 +65,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -96,6 +97,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -131,6 +133,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status ) throws Exception; @@ -168,6 +171,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags ) throws Exception; @@ -204,6 +208,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -239,6 +244,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -270,6 +276,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -306,6 +313,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java index 47586e46567..76d5b25fc96 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java @@ -60,6 +60,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId ) throws Exception; @@ -90,6 +91,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + ResponseEntity> getInventory( ) throws Exception; @@ -123,6 +125,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) throws Exception; @@ -155,6 +158,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java index 2661be7d6f9..1cdf275e81f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java @@ -59,6 +59,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) throws Exception; @@ -85,6 +86,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -138,6 +141,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -171,6 +175,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -203,6 +208,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -228,6 +234,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + ResponseEntity logoutUser( ) throws Exception; @@ -257,6 +264,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java index f95486ad7c5..44bc2d6253b 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java @@ -62,6 +62,7 @@ public interface NullableApi { value = "/nullable", consumes = "application/json" ) + default ResponseEntity nullableTest( @Parameter(name = "ObjectWithUniqueItems", description = "") @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems ) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index d60c9b32c6a..46b30fbcd28 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 3dcedd31f23..2585fd56770 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -64,6 +64,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -95,6 +96,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -166,6 +169,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -197,6 +201,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -226,6 +231,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -264,6 +270,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -293,6 +300,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -325,6 +333,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -381,6 +390,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -432,6 +442,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -472,6 +483,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -506,6 +518,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -536,6 +549,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -597,6 +611,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -629,6 +644,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -677,6 +693,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d4656f9aa95..248b6e0608b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index b2cf0f93b86..201f97dab98 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -99,6 +100,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -139,6 +141,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -245,6 +249,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -300,6 +305,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -337,6 +343,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -378,6 +385,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 3aaeb001372..fc298558287 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -168,6 +171,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index f1e788a25ee..9dc1ddab165 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -82,6 +83,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -141,6 +144,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -175,6 +179,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -222,6 +227,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -250,6 +256,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -282,6 +289,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index d60c9b32c6a..46b30fbcd28 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 3dcedd31f23..2585fd56770 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -64,6 +64,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -95,6 +96,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -166,6 +169,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -197,6 +201,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -226,6 +231,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -264,6 +270,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -293,6 +300,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -325,6 +333,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -381,6 +390,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -432,6 +442,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -472,6 +483,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -506,6 +518,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -536,6 +549,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -597,6 +611,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -629,6 +644,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -677,6 +693,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d4656f9aa95..248b6e0608b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b2cf0f93b86..201f97dab98 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -99,6 +100,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -139,6 +141,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -245,6 +249,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -300,6 +305,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -337,6 +343,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -378,6 +385,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 3aaeb001372..fc298558287 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -168,6 +171,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index f1e788a25ee..9dc1ddab165 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -82,6 +83,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -141,6 +144,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -175,6 +179,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -222,6 +227,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -250,6 +256,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -282,6 +289,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index b2a45de6de4..d75eb06d4bb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,6 +50,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 02fe3558451..59befce8d62 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -60,6 +60,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -90,6 +91,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -120,6 +122,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -150,6 +153,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -180,6 +184,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -208,6 +213,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -236,6 +242,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -264,6 +271,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -295,6 +303,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -341,6 +350,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -391,6 +401,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -430,6 +441,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -463,6 +475,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -492,6 +505,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -551,6 +565,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -582,6 +597,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -620,6 +636,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 83458c428f4..b7189e45a0a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -53,6 +53,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 7e2e5e2a05f..196d586ed8b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -58,6 +58,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -94,6 +95,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -133,6 +135,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -173,6 +176,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -209,6 +213,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -249,6 +254,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -285,6 +291,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -325,6 +332,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 9900a5292ab..82a4a7921d1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -82,6 +83,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -115,6 +117,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -147,6 +150,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index a1ad61656ec..3348d016fb1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -49,6 +49,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -77,6 +78,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -105,6 +107,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -134,6 +137,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -167,6 +171,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -199,6 +204,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -226,6 +232,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -257,6 +264,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java index 9d6bf69ac90..2ce6cb412a2 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java @@ -60,6 +60,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) + default Pet addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -95,6 +96,7 @@ public interface PetApi { value = "/pet/{petId}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default void deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -134,6 +136,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default List findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -174,6 +177,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default List findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -211,6 +215,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Pet getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -256,6 +261,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) + default Pet updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -293,6 +299,7 @@ public interface PetApi { consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) + default void updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -334,6 +341,7 @@ public interface PetApi { consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) + default ModelApiResponse uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java index 8330053569c..1a0a00c4c35 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java @@ -51,6 +51,7 @@ public interface StoreApi { value = "/store/order/{orderId}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default void deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId ) { @@ -84,6 +85,7 @@ public interface StoreApi { produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Map getInventory( ) { @@ -118,6 +120,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Order getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId ) { @@ -151,6 +154,7 @@ public interface StoreApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Order placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java index e5ab0216064..afee2557af8 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default void createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -85,6 +86,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default void createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -117,6 +119,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default void createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -150,6 +153,7 @@ public interface UserApi { value = "/user/{username}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default void deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -184,6 +188,7 @@ public interface UserApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default User getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -217,6 +222,7 @@ public interface UserApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default String loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -248,6 +254,7 @@ public interface UserApi { value = "/user/logout" ) @ResponseStatus(HttpStatus.OK) + default void logoutUser( ) { @@ -283,6 +290,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default void updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index b2a45de6de4..d75eb06d4bb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,6 +50,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 02fe3558451..59befce8d62 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -60,6 +60,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -90,6 +91,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -120,6 +122,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -150,6 +153,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -180,6 +184,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -208,6 +213,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -236,6 +242,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -264,6 +271,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -295,6 +303,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -341,6 +350,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -391,6 +401,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -430,6 +441,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -463,6 +475,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -492,6 +505,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -551,6 +565,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -582,6 +597,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -620,6 +636,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 83458c428f4..b7189e45a0a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -53,6 +53,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 7e2e5e2a05f..196d586ed8b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -58,6 +58,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -94,6 +95,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -133,6 +135,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -173,6 +176,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -209,6 +213,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -249,6 +254,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -285,6 +291,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -325,6 +332,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 9900a5292ab..82a4a7921d1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -82,6 +83,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -115,6 +117,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -147,6 +150,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index a1ad61656ec..3348d016fb1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -49,6 +49,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -77,6 +78,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -105,6 +107,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -134,6 +137,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -167,6 +171,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -199,6 +204,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -226,6 +232,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -257,6 +264,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java index 31a61e163e0..ba4b0a79d89 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java @@ -44,6 +44,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Valid @RequestBody Pet pet ) { @@ -77,6 +78,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @PathVariable("petId") Long petId ) { @@ -98,6 +100,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Valid @RequestParam(value = "status", required = true) @Deprecated List status ) { @@ -135,6 +138,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Valid @RequestParam(value = "tags", required = true) List tags ) { @@ -171,6 +175,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @PathVariable("petId") Long petId ) { @@ -211,6 +216,7 @@ public interface PetApi { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Valid @RequestBody Pet pet ) { @@ -247,6 +253,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "name", required = false) String name, @@ -272,6 +279,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java index 5c7d2045127..312c65eb077 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java @@ -42,6 +42,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{orderId}" ) + default ResponseEntity deleteOrder( @PathVariable("orderId") String orderId ) { @@ -61,6 +62,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -83,6 +85,7 @@ public interface StoreApi { value = "/store/order/{orderId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId ) { @@ -119,6 +122,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java index 332118a3a8f..7b99a0122ea 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java @@ -42,6 +42,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Valid @RequestBody User user ) { @@ -62,6 +63,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Valid @RequestBody List user ) { @@ -82,6 +84,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Valid @RequestBody List user ) { @@ -102,6 +105,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @PathVariable("username") String username ) { @@ -124,6 +128,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @PathVariable("username") String username ) { @@ -160,6 +165,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password @@ -179,6 +185,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -201,6 +208,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @PathVariable("username") String username, @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index d60c9b32c6a..46b30fbcd28 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 99c6d2fbfb0..c34845d52ae 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -64,6 +64,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -95,6 +96,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -166,6 +169,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -197,6 +201,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -226,6 +231,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -264,6 +270,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -293,6 +300,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -325,6 +333,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -381,6 +390,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -434,6 +444,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @@ -474,6 +485,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, @@ -506,6 +518,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -536,6 +549,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -597,6 +611,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -629,6 +644,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -677,6 +693,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d4656f9aa95..248b6e0608b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index caabebd7fe9..d44c170496f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -101,6 +102,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId ) { @@ -140,6 +142,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -195,6 +198,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -246,6 +250,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -301,6 +306,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -338,6 +344,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -379,6 +386,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 3aaeb001372..fc298558287 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -168,6 +171,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index f1e788a25ee..9dc1ddab165 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -82,6 +83,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -141,6 +144,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -175,6 +179,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -222,6 +227,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -250,6 +256,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -282,6 +289,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index c12111c12b6..b9ef983e22a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -56,6 +56,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 1eec5cb7b63..adc9085a3db 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -66,6 +66,7 @@ public interface FakeApi { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) @ResponseStatus(HttpStatus.OK) + default Mono createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, @ApiIgnore final ServerWebExchange exchange @@ -98,6 +99,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -130,6 +132,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, @ApiIgnore final ServerWebExchange exchange @@ -162,6 +165,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -194,6 +198,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -224,6 +229,7 @@ public interface FakeApi { produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiIgnore final ServerWebExchange exchange @@ -254,6 +260,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, @ApiIgnore final ServerWebExchange exchange @@ -284,6 +291,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, @@ -317,6 +325,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange @@ -365,6 +374,7 @@ public interface FakeApi { consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -417,6 +427,7 @@ public interface FakeApi { consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -458,6 +469,7 @@ public interface FakeApi { value = "/fake" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -493,6 +505,7 @@ public interface FakeApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, @ApiIgnore final ServerWebExchange exchange @@ -524,6 +537,7 @@ public interface FakeApi { consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.OK) + default Mono testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, @@ -587,6 +601,7 @@ public interface FakeApi { value = "/fake/test-query-parameters" ) @ResponseStatus(HttpStatus.OK) + default Mono testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -620,6 +635,7 @@ public interface FakeApi { produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testWithResultExample( @ApiIgnore final ServerWebExchange exchange ) { @@ -659,6 +675,7 @@ public interface FakeApi { consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) + default Mono uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d1ddf792356..50bce3298f5 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -59,6 +59,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index f9ce5228674..e54e8c9f6ee 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -64,6 +64,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) + default Mono addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange @@ -102,6 +103,7 @@ public interface PetApi { value = "/pet/{petId}" ) @ResponseStatus(HttpStatus.OK) + default Mono deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey, @@ -143,6 +145,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final ServerWebExchange exchange @@ -185,6 +188,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, @ApiIgnore final ServerWebExchange exchange @@ -223,6 +227,7 @@ public interface PetApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, @ApiIgnore final ServerWebExchange exchange @@ -265,6 +270,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) + default Mono updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange @@ -303,6 +309,7 @@ public interface PetApi { consumes = { "application/x-www-form-urlencoded" } ) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) + default Mono updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -345,6 +352,7 @@ public interface PetApi { consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) + default Mono uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index d8cd87bde1b..d4ac3d4ef0d 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java @@ -56,6 +56,7 @@ public interface StoreApi { value = "/store/order/{order_id}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, @ApiIgnore final ServerWebExchange exchange @@ -90,6 +91,7 @@ public interface StoreApi { produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono> getInventory( @ApiIgnore final ServerWebExchange exchange ) { @@ -124,6 +126,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, @ApiIgnore final ServerWebExchange exchange @@ -158,6 +161,7 @@ public interface StoreApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index ccfa4727894..f3abec9ba9b 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java @@ -55,6 +55,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange @@ -85,6 +86,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange @@ -115,6 +117,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange @@ -146,6 +149,7 @@ public interface UserApi { value = "/user/{username}" ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange @@ -181,6 +185,7 @@ public interface UserApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange @@ -215,6 +220,7 @@ public interface UserApi { produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) + default Mono loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @@ -244,6 +250,7 @@ public interface UserApi { value = "/user/logout" ) @ResponseStatus(HttpStatus.OK) + default Mono logoutUser( @ApiIgnore final ServerWebExchange exchange ) { @@ -276,6 +283,7 @@ public interface UserApi { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.BAD_REQUEST) + default Mono updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6508cac77b..50297537ff5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -55,6 +55,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default Mono> call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 79fccb4b431..e5963b17030 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -65,6 +65,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default Mono> createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, @ApiIgnore final ServerWebExchange exchange @@ -96,6 +97,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default Mono> fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -127,6 +129,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default Mono> fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, @ApiIgnore final ServerWebExchange exchange @@ -158,6 +161,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default Mono> fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -189,6 +193,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default Mono> fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange @@ -218,6 +223,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default Mono> responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiIgnore final ServerWebExchange exchange @@ -247,6 +253,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default Mono> testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, @ApiIgnore final ServerWebExchange exchange @@ -276,6 +283,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default Mono> testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, @@ -308,6 +316,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default Mono> testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange @@ -355,6 +364,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default Mono> testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -406,6 +416,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default Mono> testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -446,6 +457,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default Mono> testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -480,6 +492,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default Mono> testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, @ApiIgnore final ServerWebExchange exchange @@ -510,6 +523,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default Mono> testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, @@ -571,6 +585,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default Mono> testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -603,6 +618,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default Mono> testWithResultExample( @ApiIgnore final ServerWebExchange exchange ) { @@ -641,6 +657,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default Mono> uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e7f7463edc9..81c899fbf3c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -58,6 +58,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default Mono> testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index ea3b8e9fdd1..7acac446ae4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -63,6 +63,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default Mono> addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange @@ -100,6 +101,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default Mono> deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey, @@ -140,6 +142,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default Mono>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final ServerWebExchange exchange @@ -181,6 +184,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default Mono>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, @ApiIgnore final ServerWebExchange exchange @@ -218,6 +222,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default Mono> getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId, @ApiIgnore final ServerWebExchange exchange @@ -259,6 +264,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default Mono> updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange @@ -296,6 +302,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default Mono> updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -337,6 +344,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default Mono> uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 415ce7a4302..fbb19ea5777 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -55,6 +55,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default Mono> deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId, @ApiIgnore final ServerWebExchange exchange @@ -88,6 +89,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default Mono>> getInventory( @ApiIgnore final ServerWebExchange exchange ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default Mono> getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId, @ApiIgnore final ServerWebExchange exchange @@ -154,6 +157,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default Mono> placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, @ApiIgnore final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index dd53db4fc54..6071e2701f5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -54,6 +54,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default Mono> createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange @@ -83,6 +84,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default Mono> createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange @@ -112,6 +114,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default Mono> createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange @@ -142,6 +145,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default Mono> deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange @@ -176,6 +180,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default Mono> getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange @@ -209,6 +214,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default Mono> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @@ -237,6 +243,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default Mono> logoutUser( @ApiIgnore final ServerWebExchange exchange ) { @@ -268,6 +275,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default Mono> updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 77479419f4f..064a43317ee 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,6 +50,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 7a09e508684..96dce92fe57 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -58,6 +58,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -87,6 +88,7 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -116,6 +118,7 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { @@ -145,6 +148,7 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -174,6 +178,7 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -202,6 +207,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { @@ -230,6 +236,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body @@ -261,6 +268,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { @@ -307,6 +315,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -357,6 +366,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -396,6 +406,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -428,6 +439,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param ) { @@ -456,6 +468,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -488,6 +501,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @@ -529,6 +543,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9dd2cfed87c..5e55dcc9ef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -53,6 +53,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 91fda48a66a..ccc406434c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -58,6 +58,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -93,6 +94,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable @@ -173,6 +176,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable @@ -210,6 +214,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -246,6 +251,7 @@ public interface PetApi { value = "/pet/all", produces = { "application/xml", "application/json" } ) + default ResponseEntity> listAllPets( @ApiIgnore final Pageable pageable ) { @@ -285,6 +291,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -320,6 +327,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -359,6 +367,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 25f2ff66b02..9b3fe4da470 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -82,6 +83,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -115,6 +117,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -145,6 +148,7 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 1bedbe96f29..6c96e70f7be 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -48,6 +48,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body ) { @@ -74,6 +75,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -100,6 +102,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -129,6 +132,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -161,6 +165,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -192,6 +197,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -218,6 +224,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -248,6 +255,7 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index c337669679f..099ee547b44 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -51,6 +51,7 @@ public interface VersioningApi { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningHeaders( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @@ -87,6 +88,7 @@ public interface VersioningApi { headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) + default ResponseEntity versioningMix( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @@ -122,6 +124,7 @@ public interface VersioningApi { produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningQueryParams( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index 77479419f4f..064a43317ee 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -50,6 +50,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 7a09e508684..96dce92fe57 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -58,6 +58,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -87,6 +88,7 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -116,6 +118,7 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { @@ -145,6 +148,7 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -174,6 +178,7 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -202,6 +207,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { @@ -230,6 +236,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body @@ -261,6 +268,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { @@ -307,6 +315,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -357,6 +366,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -396,6 +406,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -428,6 +439,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param ) { @@ -456,6 +468,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -488,6 +501,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @@ -529,6 +543,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 9dd2cfed87c..5e55dcc9ef0 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -53,6 +53,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index 91fda48a66a..ccc406434c1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -58,6 +58,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -93,6 +94,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -132,6 +134,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable @@ -173,6 +176,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable @@ -210,6 +214,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -246,6 +251,7 @@ public interface PetApi { value = "/pet/all", produces = { "application/xml", "application/json" } ) + default ResponseEntity> listAllPets( @ApiIgnore final Pageable pageable ) { @@ -285,6 +291,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -320,6 +327,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -359,6 +367,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 25f2ff66b02..9b3fe4da470 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -50,6 +50,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -82,6 +83,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -115,6 +117,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -145,6 +148,7 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 1bedbe96f29..6c96e70f7be 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -48,6 +48,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body ) { @@ -74,6 +75,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -100,6 +102,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -129,6 +132,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -161,6 +165,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -192,6 +197,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -218,6 +224,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -248,6 +255,7 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java index 2d60e0f233d..c0b9e172850 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java @@ -53,6 +53,7 @@ public interface VersioningApi { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningHeaders( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -89,6 +90,7 @@ public interface VersioningApi { headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) + default ResponseEntity versioningMix( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @@ -122,6 +124,7 @@ public interface VersioningApi { produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningQueryParams( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 92f1cead2d7..d8d420d0f9d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index ec315896a8e..b6cb0c0b58a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -62,6 +62,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -92,6 +93,7 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -122,6 +124,7 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { @@ -161,6 +164,7 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -191,6 +195,7 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -220,6 +225,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { @@ -249,6 +255,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body @@ -281,6 +288,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { @@ -337,6 +345,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -388,6 +397,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -428,6 +438,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -461,6 +472,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param ) { @@ -490,6 +502,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -523,6 +536,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @@ -565,6 +579,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index afa48af929f..a86c3750786 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 8c1fe9173b6..57e506ba5a3 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -98,6 +99,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -138,6 +140,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable @@ -246,6 +250,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -297,6 +302,7 @@ public interface PetApi { value = "/pet/all", produces = { "application/xml", "application/json" } ) + default ResponseEntity> listAllPets( @ApiIgnore final Pageable pageable ) { @@ -351,6 +357,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -387,6 +394,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -427,6 +435,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 95d169bee8a..8540b17e0eb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -166,6 +169,7 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 86cf8340c59..38033c4e763 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -52,6 +52,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body ) { @@ -79,6 +80,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -106,6 +108,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -136,6 +139,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -169,6 +173,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -215,6 +220,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -242,6 +248,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -273,6 +280,7 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index b0b7c549fe8..c472c8a5ec4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -55,6 +55,7 @@ public interface VersioningApi { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningHeaders( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @@ -101,6 +102,7 @@ public interface VersioningApi { headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) + default ResponseEntity versioningMix( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @@ -146,6 +148,7 @@ public interface VersioningApi { produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningQueryParams( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 92f1cead2d7..d8d420d0f9d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index ec315896a8e..b6cb0c0b58a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -62,6 +62,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -92,6 +93,7 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -122,6 +124,7 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body ) { @@ -161,6 +164,7 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -191,6 +195,7 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -220,6 +225,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body ) { @@ -249,6 +255,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User body @@ -281,6 +288,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { @@ -337,6 +345,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -388,6 +397,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -428,6 +438,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -461,6 +472,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param ) { @@ -490,6 +502,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -523,6 +536,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @@ -565,6 +579,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index afa48af929f..a86c3750786 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body ) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 8c1fe9173b6..57e506ba5a3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -98,6 +99,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -138,6 +140,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final Pageable pageable @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, @ApiIgnore final Pageable pageable @@ -246,6 +250,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -297,6 +302,7 @@ public interface PetApi { value = "/pet/all", produces = { "application/xml", "application/json" } ) + default ResponseEntity> listAllPets( @ApiIgnore final Pageable pageable ) { @@ -351,6 +357,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body ) { @@ -387,6 +394,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -427,6 +435,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 95d169bee8a..8540b17e0eb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -166,6 +169,7 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 86cf8340c59..38033c4e763 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -52,6 +52,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user" ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body ) { @@ -79,6 +80,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithArray" ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -106,6 +108,7 @@ public interface UserApi { method = RequestMethod.POST, value = "/user/createWithList" ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body ) { @@ -136,6 +139,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -169,6 +173,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -215,6 +220,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -242,6 +248,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -273,6 +280,7 @@ public interface UserApi { method = RequestMethod.PUT, value = "/user/{username}" ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java index 16f10f4f0e8..cc15e05ab10 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java @@ -57,6 +57,7 @@ public interface VersioningApi { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningHeaders( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -103,6 +104,7 @@ public interface VersioningApi { headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) + default ResponseEntity versioningMix( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @@ -146,6 +148,7 @@ public interface VersioningApi { produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) + default ResponseEntity versioningQueryParams( @NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index d60c9b32c6a..46b30fbcd28 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 67991eb5e7f..c159d9dd71a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -64,6 +64,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -95,6 +96,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -166,6 +169,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -197,6 +201,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -226,6 +231,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -264,6 +270,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -293,6 +300,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody User user @@ -325,6 +333,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { @@ -381,6 +390,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -432,6 +442,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, @@ -472,6 +483,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -506,6 +518,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -536,6 +549,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -597,6 +611,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -629,6 +644,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -677,6 +693,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d4656f9aa95..248b6e0608b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 2585f8e5e8b..f2d7bb655a3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -99,6 +100,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) Optional apiKey @@ -139,6 +141,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -245,6 +249,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -300,6 +305,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -337,6 +343,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -378,6 +385,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 3aaeb001372..fc298558287 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -168,6 +171,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index f1e788a25ee..9dc1ddab165 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -82,6 +83,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -141,6 +144,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -175,6 +179,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -222,6 +227,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -250,6 +256,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -282,6 +289,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 6054f5963bb..f9a9b237c0a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -69,6 +69,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 3ddc4c175c7..e9d943cdee9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -78,6 +78,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem ) { @@ -110,6 +111,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -142,6 +144,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { @@ -183,6 +186,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -215,6 +219,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -244,6 +249,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -282,6 +288,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { @@ -310,6 +317,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user @@ -344,6 +352,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { @@ -401,6 +410,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -453,6 +463,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -494,6 +505,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -529,6 +541,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -560,6 +573,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -622,6 +636,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @@ -655,6 +670,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -702,6 +718,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 61a6861c282..2671d846df9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -72,6 +72,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 96df22adeb4..c19d7e98bf0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -73,6 +73,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -108,6 +109,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey @@ -147,6 +149,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status ) { @@ -202,6 +205,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -256,6 +260,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { @@ -309,6 +314,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { @@ -344,6 +350,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -384,6 +391,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 3780fd4e0b3..13e89f50f20 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -68,6 +68,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId ) { @@ -102,6 +103,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -139,6 +141,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { @@ -189,6 +192,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index adef91f65b1..0324a3ddfe3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -67,6 +67,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { @@ -97,6 +98,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -127,6 +129,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { @@ -158,6 +161,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -195,6 +199,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { @@ -245,6 +250,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password @@ -274,6 +280,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -307,6 +314,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 0f02c6dd185..b1e1c11f707 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -54,6 +54,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity call123testSpecialTags( @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 6547d636995..64bc1021c9b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -64,6 +64,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) + default ResponseEntity createXmlItem( @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto ) { @@ -95,6 +96,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body ) { @@ -126,6 +128,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterCompositeSerialize( @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto outerCompositeDto ) { @@ -166,6 +169,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body ) { @@ -197,6 +201,7 @@ public interface FakeApi { produces = { "*/*" }, consumes = { "application/json" } ) + default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body ) { @@ -226,6 +231,7 @@ public interface FakeApi { value = "/fake/{petId}/response-object-different-names", produces = { "application/json" } ) + default ResponseEntity responseObjectDifferentNames( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId ) { @@ -264,6 +270,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) + default ResponseEntity testBodyWithFileSchema( @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ) { @@ -293,6 +300,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) + default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, @ApiParam(value = "", required = true) @Valid @RequestBody UserDto userDto @@ -325,6 +333,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClientModel( @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { @@ -381,6 +390,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, @@ -432,6 +442,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testEnumParameters( @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, @@ -472,6 +483,7 @@ public interface FakeApi { method = RequestMethod.DELETE, value = "/fake" ) + default ResponseEntity testGroupParameters( @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, @@ -506,6 +518,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) + default ResponseEntity testInlineAdditionalProperties( @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { @@ -536,6 +549,7 @@ public interface FakeApi { value = "/fake/jsonFormData", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity testJsonFormData( @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 @@ -597,6 +611,7 @@ public interface FakeApi { method = RequestMethod.PUT, value = "/fake/test-query-parameters" ) + default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @@ -629,6 +644,7 @@ public interface FakeApi { value = "/fake/response-with-example", produces = { "application/json" } ) + default ResponseEntity testWithResultExample( ) { @@ -677,6 +693,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFileWithRequiredFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 34f4335f2f1..8b0aaf1d7d2 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -57,6 +57,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) + default ResponseEntity testClassname( @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index b8b35dd7227..323dabc8568 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -62,6 +62,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity addPet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { @@ -99,6 +100,7 @@ public interface PetApi { method = RequestMethod.DELETE, value = "/pet/{petId}" ) + default ResponseEntity deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey @@ -139,6 +141,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status ) { @@ -194,6 +197,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags ) { @@ -245,6 +249,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getPetById( @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId ) { @@ -300,6 +305,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) + default ResponseEntity updatePet( @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { @@ -337,6 +343,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) + default ResponseEntity updatePetWithForm( @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, @@ -378,6 +385,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) + default ResponseEntity uploadFile( @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 539e6cda50b..051ce4c42aa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -54,6 +54,7 @@ public interface StoreApi { method = RequestMethod.DELETE, value = "/store/order/{order_id}" ) + default ResponseEntity deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId ) { @@ -87,6 +88,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) + default ResponseEntity> getInventory( ) { @@ -121,6 +123,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getOrderById( @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId ) { @@ -168,6 +171,7 @@ public interface StoreApi { produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) + default ResponseEntity placeOrder( @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto ) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 1b3cdf967fd..7d8ef02238b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -53,6 +53,7 @@ public interface UserApi { value = "/user", consumes = { "application/json" } ) + default ResponseEntity createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto userDto ) { @@ -82,6 +83,7 @@ public interface UserApi { value = "/user/createWithArray", consumes = { "application/json" } ) + default ResponseEntity createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { @@ -111,6 +113,7 @@ public interface UserApi { value = "/user/createWithList", consumes = { "application/json" } ) + default ResponseEntity createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { @@ -141,6 +144,7 @@ public interface UserApi { method = RequestMethod.DELETE, value = "/user/{username}" ) + default ResponseEntity deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username ) { @@ -175,6 +179,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) + default ResponseEntity getUserByName( @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username ) { @@ -222,6 +227,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password @@ -250,6 +256,7 @@ public interface UserApi { method = RequestMethod.GET, value = "/user/logout" ) + default ResponseEntity logoutUser( ) { @@ -282,6 +289,7 @@ public interface UserApi { value = "/user/{username}", consumes = { "application/json" } ) + default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto userDto